summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatherine Noll <noll.catherine@gmail.com>2021-03-27 22:25:11 -0400
committerCatherine Noll <noll.catherine@gmail.com>2021-03-27 22:27:51 -0400
commit6dd4209e75252cb28563a618ec91285d97a07cd6 (patch)
treeba060df9911c66e811ec72bb1d974b024940803b
parent2e02bbec383d719a83c5a5193e7f8cd1e07cae12 (diff)
Remove unnecessary check in get_themes and clean up --show-themes cli docstring
-rw-r--r--src/cli.rs2
-rw-r--r--src/options/get.rs13
2 files changed, 6 insertions, 9 deletions
diff --git a/src/cli.rs b/src/cli.rs
index e90c26d7..a771ad53 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -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)
}
}
}