mirror of
https://github.com/sharkdp/bat
synced 2024-11-27 06:10:20 +00:00
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.
This commit is contained in:
parent
6e91ba83b7
commit
93b25d75a0
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue