summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan P. <eth-p+git@hidden.email>2024-04-06 17:05:46 -0700
committerEthan P. <eth-p+git@hidden.email>2024-07-30 21:21:58 -0700
commit93b25d75a0db2bc5fef4e147a92af55373781046 (patch)
tree80faa1b73b6f687cf2d24bd804e28f446c0d6ff8
parent6e91ba83b7663d22f88788d89595513e55b4ec0f (diff)
Join env var options with "=" instead of " "
Joining them with a space was causing certain styles (e.g. `-grid`) to be misinterpreted as a separate option.
-rw-r--r--src/bin/bat/config.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/bat/config.rs b/src/bin/bat/config.rs
index 9e38dfa4..6fa18f09 100644
--- a/src/bin/bat/config.rs
+++ b/src/bin/bat/config.rs
@@ -146,8 +146,11 @@ pub fn get_args_from_env_vars() -> Vec<OsString> {
("--style", "BAT_STYLE"),
]
.iter()
- .filter_map(|(flag, key)| env::var(key).ok().map(|var| [flag.to_string(), var]))
- .flatten()
+ .filter_map(|(flag, key)| {
+ env::var(key)
+ .ok()
+ .map(|var| [flag.to_string(), var].join("="))
+ })
.map(|a| a.into())
.collect()
}