mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-08 00:44:30 +01: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 handle = output_type.handle()?;
|
||||
let mut printer = Printer::new(handle, &options);
|
||||
|
Loading…
Reference in New Issue
Block a user