mirror of
https://github.com/sharkdp/bat
synced 2024-11-23 12:23:19 +00:00
make bat -L use plain style
This commit is contained in:
parent
cffacad306
commit
bf96e6e642
1 changed files with 8 additions and 3 deletions
|
@ -36,6 +36,7 @@ use bat::{
|
||||||
input::Input,
|
input::Input,
|
||||||
style::{StyleComponent, StyleComponents},
|
style::{StyleComponent, StyleComponents},
|
||||||
MappingTarget,
|
MappingTarget,
|
||||||
|
PagingMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
|
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") {
|
if app.matches.is_present("list-languages") {
|
||||||
let languages: String = get_languages(&config)?;
|
let languages: String = get_languages(&config)?;
|
||||||
let inputs: Vec<Input> = vec!(Input::from_reader(Box::new(languages.as_bytes())));
|
let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
|
||||||
let config = app.config(&inputs)?;
|
let plain_config = Config {
|
||||||
run_controller(inputs, &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") {
|
} else if app.matches.is_present("list-themes") {
|
||||||
list_themes(&config)?;
|
list_themes(&config)?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
|
|
Loading…
Reference in a new issue