From 84b070239951a1fff778812393b670cc5c06244d Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 16 Dec 2020 20:41:50 +0100 Subject: [PATCH] only print themes hint in interactive mode --- CHANGELOG.md | 2 ++ src/bin/bat/main.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef17a38..8cabba21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ## Bugfixes +- only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube) + ## Other ## Syntaxes diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index eb6f75bc..cb50a84f 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -200,19 +200,19 @@ pub fn list_themes(cfg: &Config) -> Result<()> { .ok(); writeln!(stdout)?; } + writeln!( + stdout, + "Further themes can be installed to '{}', \ + and are added to the cache with `bat cache --build`. \ + For more information, see:\n\n \ + https://github.com/sharkdp/bat#adding-new-themes", + config_file().join("themes").to_string_lossy() + )?; } else { for theme in assets.themes() { writeln!(stdout, "{}", theme)?; } } - writeln!( - stdout, - "Further themes can be installed to '{}', \ - and are added to the cache with `bat cache --build`. \ - For more information, see:\n\n \ - https://github.com/sharkdp/bat#adding-new-themes", - config_file().join("themes").to_string_lossy() - )?; Ok(()) }