mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-09 15:18:17 +01:00
Paint file extensions in green
This commit is contained in:
parent
ebdef04c8f
commit
fd68af8031
@ -457,7 +457,7 @@ fn run() -> Result<()> {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("list-languages")
|
Arg::with_name("list-languages")
|
||||||
.long("list-languages")
|
.long("list-languages")
|
||||||
.help("Displays supported languages")
|
.help("Displays supported languages"),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("cache")
|
SubCommand::with_name("cache")
|
||||||
@ -576,7 +576,7 @@ fn run() -> Result<()> {
|
|||||||
.max()
|
.max()
|
||||||
.unwrap_or(32); // Fallback width if they have no language definitions.
|
.unwrap_or(32); // Fallback width if they have no language definitions.
|
||||||
|
|
||||||
let separator = " | ";
|
let separator = " ";
|
||||||
for lang in languages {
|
for lang in languages {
|
||||||
if lang.hidden {
|
if lang.hidden {
|
||||||
continue;
|
continue;
|
||||||
@ -599,7 +599,7 @@ fn run() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
num_chars += new_chars;
|
num_chars += new_chars;
|
||||||
print!("{}", word);
|
print!("{}", Green.paint(word as &str));
|
||||||
if extension.peek().is_some() {
|
if extension.peek().is_some() {
|
||||||
print!("{}", comma_separator);
|
print!("{}", comma_separator);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user