mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-05 20:39:27 +01:00
Add short flag for --paging=never
This commit is contained in:
parent
b0191cdf2c
commit
2575aae945
@ -85,6 +85,8 @@ impl App {
|
|||||||
if self.matches.occurrences_of("plain") > 1 {
|
if self.matches.occurrences_of("plain") > 1 {
|
||||||
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
||||||
PagingMode::Never
|
PagingMode::Never
|
||||||
|
} else if self.matches.is_present("disable-paging") {
|
||||||
|
PagingMode::Never
|
||||||
} else if inputs.iter().any(Input::is_stdin) {
|
} else if inputs.iter().any(Input::is_stdin) {
|
||||||
// If we are reading from stdin, only enable paging if we write to an
|
// If we are reading from stdin, only enable paging if we write to an
|
||||||
// interactive terminal and if we do not *read* from an interactive
|
// interactive terminal and if we do not *read* from an interactive
|
||||||
|
@ -275,6 +275,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
Possible values: *auto*, never, always.",
|
Possible values: *auto*, never, always.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("disable-paging")
|
||||||
|
.short("P")
|
||||||
|
.overrides_with("disable-paging")
|
||||||
|
.help("Alias for --paging=never")
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("pager")
|
Arg::with_name("pager")
|
||||||
.long("pager")
|
.long("pager")
|
||||||
|
Loading…
Reference in New Issue
Block a user