mirror of
https://github.com/sharkdp/bat.git
synced 2025-04-24 03:28:25 +02: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
@ -146,8 +146,11 @@ pub fn get_args_from_env_vars() -> Vec<OsString> {
|
|||||||
("--style", "BAT_STYLE"),
|
("--style", "BAT_STYLE"),
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(flag, key)| env::var(key).ok().map(|var| [flag.to_string(), var]))
|
.filter_map(|(flag, key)| {
|
||||||
.flatten()
|
env::var(key)
|
||||||
|
.ok()
|
||||||
|
.map(|var| [flag.to_string(), var].join("="))
|
||||||
|
})
|
||||||
.map(|a| a.into())
|
.map(|a| a.into())
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user