1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-01-19 04:21:06 +00:00

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

View File

@ -195,6 +195,13 @@ impl App {
.value_of("theme") .value_of("theme")
.map(String::from) .map(String::from)
.or_else(|| env::var("BAT_THEME").ok()) .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)), .unwrap_or_else(|| String::from(BAT_THEME_DEFAULT)),
line_ranges: LineRanges::from( line_ranges: LineRanges::from(
self.matches self.matches