on master help sign in
Add -pp for plain styling and no pager
fde00eeEthan P
src/app.rs+4−1
@@ -143,7 +143,10 @@ impl App {
143 Some("always") => PagingMode::Always,
143 Some("always") => PagingMode::Always,
144 Some("never") => PagingMode::Never,
144 Some("never") => PagingMode::Never,
145 Some("auto") | _ => {
145 Some("auto") | _ => {
146+ if self.matches.occurrences_of("plain") > 1 {
147+ // If we have -pp as an option when in auto mode, the pager should be disabled.
148+ PagingMode::Never
146− if files.contains(&InputFile::StdIn) {
149+ } else if files.contains(&InputFile::StdIn) {
147 // If we are reading from stdin, only enable paging if we write to an
150 // If we are reading from stdin, only enable paging if we write to an
148 // interactive terminal and if we do not *read* from an interactive
151 // interactive terminal and if we do not *read* from an interactive
149 // terminal.
152 // terminal.
src/clap_app.rs+3−2
@@ -143,10 +143,11 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
143 .overrides_with("number")
143 .overrides_with("number")
144 .short("p")
144 .short("p")
145 .long("plain")
145 .long("plain")
146+ .multiple(true)
146 .help("Show plain style (alias for '--style=plain').")
147 .help("Show plain style (alias for '--style=plain').")
147 .long_help(
148 .long_help(
148− "Only show plain style, no decorations. This is an alias for \
149+ "Only show plain style, no decorations. When '-p' is used, this is an alias for \
149− '--style=plain'",
150+ '--style=plain'. When '-pp' is used, this is an alias for '--style=plain --pager=never'.",
150 ),
151 ),
151 )
152 )
152 .arg(
153 .arg(