fix(cli): Add styling to --file-types

This commit is contained in:
Ed Page 2023-10-27 09:19:42 -05:00
parent 686e4cebe8
commit 1ca321659d
2 changed files with 7 additions and 3 deletions

View file

@ -67,9 +67,11 @@ impl Report for PrintBrief {
} }
Message::Typo(msg) => print_brief_correction(msg)?, Message::Typo(msg) => print_brief_correction(msg)?,
Message::FileType(msg) => { Message::FileType(msg) => {
let info = INFO.render();
let reset = anstyle::Reset.render();
writeln!( writeln!(
stdout().lock(), stdout().lock(),
"{}:{}", "{info}{}{reset}: {}",
msg.path.display(), msg.path.display(),
msg.file_type.unwrap_or("-") msg.file_type.unwrap_or("-")
)?; )?;
@ -99,9 +101,11 @@ impl Report for PrintLong {
} }
Message::Typo(msg) => print_long_correction(msg)?, Message::Typo(msg) => print_long_correction(msg)?,
Message::FileType(msg) => { Message::FileType(msg) => {
let info = INFO.render();
let reset = anstyle::Reset.render();
writeln!( writeln!(
stdout().lock(), stdout().lock(),
"{}:{}", "{info}{}{reset}: {}",
msg.path.display(), msg.path.display(),
msg.file_type.unwrap_or("-") msg.file_type.unwrap_or("-")
)?; )?;

View file

@ -6,6 +6,6 @@ stdin = '''
Destory Destory
''' '''
stdout = """ stdout = """
./key.asc:asc ./key.asc: asc
""" """
stderr = "" stderr = ""