on master help sign in
make bat -L use plain style
bf96e6eStefan Kunkel
src/bin/bat/main.rs+8−3
@@ -36,6 +36,7 @@ use bat::{
36 input::Input,
36 input::Input,
37 style::{StyleComponent, StyleComponents},
37 style::{StyleComponent, StyleComponents},
38 MappingTarget,
38 MappingTarget,
39+ PagingMode,
39};
40};
40
41
41const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
42const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
@@ -248,9 +249,13 @@ fn run() -> Result<bool> {
248
249
249 if app.matches.is_present("list-languages") {
250 if app.matches.is_present("list-languages") {
250 let languages: String = get_languages(&config)?;
251 let languages: String = get_languages(&config)?;
251− let inputs: Vec<Input> = vec!(Input::from_reader(Box::new(languages.as_bytes())));
252+ let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
252− let config = app.config(&inputs)?;
253+ let plain_config = Config {
254+ style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
255+ paging_mode: PagingMode::QuitIfOneScreen,
256+ ..Default::default()
257+ };
253− run_controller(inputs, &config)
258+ run_controller(inputs, &plain_config)
254 } else if app.matches.is_present("list-themes") {
259 } else if app.matches.is_present("list-themes") {
255 list_themes(&config)?;
260 list_themes(&config)?;
256 Ok(true)
261 Ok(true)