mirror of
https://github.com/sharkdp/bat
synced 2024-11-15 00:12:57 +00:00
Display language and extensions from loaded assets.
This commit is contained in:
parent
67bed73e15
commit
9b0877102c
20
src/main.rs
20
src/main.rs
@ -565,6 +565,26 @@ fn run() -> Result<()> {
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
if let Some(_) = app_matches.values_of("list languages") {
|
||||||
|
let languages = assets.syntax_set.syntaxes();
|
||||||
|
|
||||||
|
for lang in languages {
|
||||||
|
print!("{}\t", lang.name);
|
||||||
|
|
||||||
|
for i in 0..lang.file_extensions.len() {
|
||||||
|
print!("{}", lang.file_extensions[i]);
|
||||||
|
|
||||||
|
if i < lang.file_extensions.len() - 1 {
|
||||||
|
print!(", ");
|
||||||
|
} else {
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let mut output_type = get_output_type(options.paging);
|
let mut output_type = get_output_type(options.paging);
|
||||||
let handle = output_type.handle()?;
|
let handle = output_type.handle()?;
|
||||||
let mut printer = Printer::new(handle, &options);
|
let mut printer = Printer::new(handle, &options);
|
||||||
|
Loading…
Reference in New Issue
Block a user