Add short flag for --paging=never
commit2575aae945a78b5d976c0a21faba730b7bc837f1
authorDash Peters <dpeters@calacademy.org>
dateTue 30 Jun 2020, 12:18 (6 years ago)
parentb0191cd
src/bin/bat/app.rs+2
@@ -85,6 +85,8 @@ impl App {
8585 if self.matches.occurrences_of("plain") > 1 {
8686 // If we have -pp as an option when in auto mode, the pager should be disabled.
8787 PagingMode::Never
88+ } else if self.matches.is_present("disable-paging") {
89+ PagingMode::Never
8890 } else if inputs.iter().any(Input::is_stdin) {
8991 // If we are reading from stdin, only enable paging if we write to an
9092 // interactive terminal and if we do not *read* from an interactive
src/bin/bat/clap_app.rs+6
@@ -275,6 +275,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
275275 Possible values: *auto*, never, always.",
276276 ),
277277 )
278+ .arg(
279+ Arg::with_name("disable-paging")
280+ .short("P")
281+ .overrides_with("disable-paging")
282+ .help("Alias for --paging=never")
283+ )
278284 .arg(
279285 Arg::with_name("pager")
280286 .long("pager")