summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDash Peters <dpeters@calacademy.org>2020-06-30 12:18:17 -0700
committerDash Peters <dpeters@calacademy.org>2020-06-30 12:19:22 -0700
commit2575aae945a78b5d976c0a21faba730b7bc837f1 (patch)
tree3a4e82805525e5debf59ebd4a8a216abee5a150a /src
parentb0191cdf2c52496fd92b835adf3cb7b0787154fa (diff)
Add short flag for --paging=never
Diffstat (limited to 'src')
-rw-r--r--src/bin/bat/app.rs2
-rw-r--r--src/bin/bat/clap_app.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs
index 432b8c57..4793c4fb 100644
--- a/src/bin/bat/app.rs
+++ b/src/bin/bat/app.rs
@@ -85,6 +85,8 @@ impl App {
if self.matches.occurrences_of("plain") > 1 {
// If we have -pp as an option when in auto mode, the pager should be disabled.
PagingMode::Never
+ } else if self.matches.is_present("disable-paging") {
+ PagingMode::Never
} else if inputs.iter().any(Input::is_stdin) {
// 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
diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs
index 4182b76e..b7c371fe 100644
--- a/src/bin/bat/clap_app.rs
+++ b/src/bin/bat/clap_app.rs
@@ -276,6 +276,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
),
)
.arg(
+ Arg::with_name("disable-paging")
+ .short("P")
+ .overrides_with("disable-paging")
+ .help("Alias for --paging=never")
+ )
+ .arg(
Arg::with_name("pager")
.long("pager")
.overrides_with("pager")