@@ -364,22 +364,24 @@ impl App {
364 let paging_mode = match self.matches.value_of("paging") {
364 let paging_mode = match self.matches.value_of("paging") {
365 Some("always") => PagingMode::Always,
365 Some("always") => PagingMode::Always,
366 Some("never") => PagingMode::Never,
366 Some("never") => PagingMode::Never,
367+ Some("auto") | _ => {
367− Some("auto") | _ => if files.contains(&InputFile::StdIn) {
368+ if files.contains(&InputFile::StdIn) {
368− // If we are reading from stdin, only enable paging if we write to an
369+ // If we are reading from stdin, only enable paging if we write to an
369− // interactive terminal and if we do not *read* from an interactive
370+ // interactive terminal and if we do not *read* from an interactive
370− // terminal.
371+ // terminal.
371− if self.interactive_output && !atty::is(Stream::Stdin) {
372+ if self.interactive_output && !atty::is(Stream::Stdin) {
372− PagingMode::QuitIfOneScreen
373+ PagingMode::QuitIfOneScreen
373− } else {
374+ } else {
374− PagingMode::Never
375+ PagingMode::Never
377− if self.interactive_output {
378− PagingMode::QuitIfOneScreen
378+ if self.interactive_output {
379+ PagingMode::QuitIfOneScreen
380− PagingMode::Never
381+ PagingMode::Never
385 Ok(Config {
387 Ok(Config {
@@ -393,11 +395,13 @@ impl App {
393 match self.matches.value_of("wrap") {
395 match self.matches.value_of("wrap") {
394 Some("character") => OutputWrap::Character,
396 Some("character") => OutputWrap::Character,
395 Some("never") => OutputWrap::None,
397 Some("never") => OutputWrap::None,
398+ Some("auto") | _ => {
396− Some("auto") | _ => if output_components.plain() {
399+ if output_components.plain() {
397− OutputWrap::None
400+ OutputWrap::None
398− } else {
401+ } else {
399− OutputWrap::Character
402+ OutputWrap::Character
403 colored_output: match self.matches.value_of("color") {
407 colored_output: match self.matches.value_of("color") {
@@ -450,8 +454,10 @@ impl App {
451 InputFile::Ordinary(filename)
455 InputFile::Ordinary(filename)
453− }).collect()
458+ .collect()
454− }).unwrap_or_else(|| vec![InputFile::StdIn])
460+ .unwrap_or_else(|| vec![InputFile::StdIn])
457 fn output_components(&self) -> Result<OutputComponents> {
463 fn output_components(&self) -> Result<OutputComponents> {