diff options
author | Catherine Noll <noll.catherine@gmail.com> | 2021-03-27 22:25:11 -0400 |
---|---|---|
committer | Catherine Noll <noll.catherine@gmail.com> | 2021-03-27 22:27:51 -0400 |
commit | 6dd4209e75252cb28563a618ec91285d97a07cd6 (patch) | |
tree | ba060df9911c66e811ec72bb1d974b024940803b | |
parent | 2e02bbec383d719a83c5a5193e7f8cd1e07cae12 (diff) |
Remove unnecessary check in get_themes and clean up --show-themes cli docstring
-rw-r--r-- | src/cli.rs | 2 | ||||
-rw-r--r-- | src/options/get.rs | 13 |
2 files changed, 6 insertions, 9 deletions
@@ -271,7 +271,7 @@ pub struct Opt { /// Show available delta themes with an example of highlighted diff output. /// If diff output is supplied on standard input then this will be used for the demo. For - /// example: `git show --color=always | delta --show-themes`. + /// example: `git show | delta --show-themes`. /// By default, if delta is configured to use a light theme (as set by the user or inferred by the /// BAT_THEME), only displays light themes, otherwise will only display dark themes, unless the /// --dark or --light command line arguments are included. diff --git a/src/options/get.rs b/src/options/get.rs index a1bbecae..5752283a 100644 --- a/src/options/get.rs +++ b/src/options/get.rs @@ -49,14 +49,11 @@ pub fn get_themes(git_config: Option<git_config::GitConfig>) -> Vec<String> { for e in &git_config.unwrap().config.entries(None).unwrap() { let entry = e.unwrap(); let entry_name = entry.name().unwrap(); - let entry_value = entry.value().unwrap(); - if entry_value == "true" { - let caps = GIT_CONFIG_THEME_REGEX.captures(entry_name); - if let Some(caps) = caps { - let name = caps.get(1).map_or("", |m| m.as_str()).to_string(); - if !themes.contains(&name) { - themes.push(name) - } + let caps = GIT_CONFIG_THEME_REGEX.captures(entry_name); + if let Some(caps) = caps { + let name = caps.get(1).map_or("", |m| m.as_str()).to_string(); + if !themes.contains(&name) { + themes.push(name) } } } |