on master help sign in
BAT_STYLE accounts for multiple styles (ie numbers,header)
commit7897260bf00fc017da383a783eede2583206acc5 authorms2300 <matt.sewall@gmail.com> dateMon 10 Sep 2018, 21:58 (8 years ago) parentcf24986
1 file changed+11−11
src/app.rs+11−11
src/app.rs+11−11
@@ -439,17 +439,17 @@ impl App {
439439 acc
440440 })
441441 } else {
442− let style = env::var("BAT_STYLE").unwrap_or(String::from(BAT_STYLE_DEFAULT));
443− match OutputComponent::from_str(&style) {
444− Ok(s) => [s]
445− .iter()
446− .map(|style| style.components(self.interactive_output))
447− .fold(HashSet::new(), |mut acc, components| {
448− acc.extend(components.iter().cloned());
449− acc
450− }),
451− Err(_) => HashSet::new(),
452− }
442+ let style_str = env::var("BAT_STYLE").unwrap_or(String::from(BAT_STYLE_DEFAULT));
443+ style_str
444+ .split(",")
445+ .map(|x| OutputComponent::from_str(&x))
446+ .map(|s| match s {
447+ Ok(style) => style.components(self.interactive_output),
448+ Err(_) => &[],
449+ }).fold(HashSet::new(), |mut acc, components| {
450+ acc.extend(components.iter().cloned());
451+ acc
452+ })
453453 },
454454 ))
455455 }