2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-16 21:25:56 +00:00

make bat -L use plain style

This commit is contained in:
Stefan Kunkel 2020-11-27 14:38:25 +01:00 committed by David Peter
parent cffacad306
commit bf96e6e642

View File

@ -36,6 +36,7 @@ use bat::{
input::Input,
style::{StyleComponent, StyleComponents},
MappingTarget,
PagingMode,
};
const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
@ -248,9 +249,13 @@ fn run() -> Result<bool> {
if app.matches.is_present("list-languages") {
let languages: String = get_languages(&config)?;
let inputs: Vec<Input> = vec!(Input::from_reader(Box::new(languages.as_bytes())));
let config = app.config(&inputs)?;
run_controller(inputs, &config)
let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
let plain_config = Config {
style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
paging_mode: PagingMode::QuitIfOneScreen,
..Default::default()
};
run_controller(inputs, &plain_config)
} else if app.matches.is_present("list-themes") {
list_themes(&config)?;
Ok(true)