diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-11 09:50:11 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-11 09:50:11 -0400 |
commit | bacf1c8567f20804532009320adfd8a04e641b9b (patch) | |
tree | 9191ac92b9aef4a959f256c4345f7861c50ed18e /src/main.rs | |
parent | 38dc076164c15f84ee2a2d74d8aa252313a29a76 (diff) |
Run --list-syntax-themes etc before diff mode tty detection
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 79a5376e..b290c32a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,14 +59,6 @@ fn main() -> std::io::Result<()> { let config = config::Config::from_arg_matches(cli::Opt::clap().get_matches(), &mut git_config); - if atty::is(atty::Stream::Stdin) { - return diff( - config.minus_file.as_ref(), - config.plus_file.as_ref(), - &config, - ); - } - if config.list_languages { list_languages()?; process::exit(0); @@ -79,6 +71,12 @@ fn main() -> std::io::Result<()> { } else if config.show_background_colors { show_background_colors(&config); process::exit(0); + } else if atty::is(atty::Stream::Stdin) { + return diff( + config.minus_file.as_ref(), + config.plus_file.as_ref(), + &config, + ); } let mut output_type = OutputType::from_mode(config.paging_mode, None, &config).unwrap(); |