Accept "default" as a theme

This commit is contained in:
Franco Victorio 2019-11-26 19:43:20 -03:00 committed by David Peter
parent 3523f60299
commit f94ff93953
1 changed files with 7 additions and 0 deletions

View File

@ -195,6 +195,13 @@ impl App {
.value_of("theme")
.map(String::from)
.or_else(|| env::var("BAT_THEME").ok())
.map(|s| {
if s == String::from("default") {
String::from(BAT_THEME_DEFAULT)
} else {
s
}
})
.unwrap_or_else(|| String::from(BAT_THEME_DEFAULT)),
line_ranges: LineRanges::from(
self.matches