mirror of
https://github.com/sharkdp/bat
synced 2026-07-28 17:51:44 +00:00
When specifying style multiple times the last occurence wins
Closes: #367
This commit is contained in:
committed by
David Peter
parent
c1246fcd53
commit
7c98a1c901
+8
-2
@@ -270,8 +270,14 @@ impl App {
|
||||
.collect::<Result<Vec<OutputComponent>>>()
|
||||
}))?;
|
||||
|
||||
values_t!(matches.values_of("style"), OutputComponent)
|
||||
.ok()
|
||||
matches.value_of("style")
|
||||
.map(|styles| {
|
||||
styles
|
||||
.split(",")
|
||||
.map(|style| style.parse::<OutputComponent>())
|
||||
.filter_map(|style| style.ok())
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
.or(env_style_components)
|
||||
.unwrap_or(vec![OutputComponent::Full])
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user