Skip to content

Commit

Permalink
Color groups in --list output (#2340)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Sep 3, 2024
1 parent f222b02 commit d8d6b36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ impl Color {
self.restyle(Style::new().fg(Red).bold())
}

pub(crate) fn group(self) -> Self {
self.restyle(Style::new().fg(Yellow).bold())
}

pub(crate) fn warning(self) -> Self {
self.restyle(Style::new().fg(Yellow).bold())
}
Expand Down
5 changes: 4 additions & 1 deletion src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,10 @@ impl Subcommand {

if !no_groups {
if let Some(group) = &group {
println!("{list_prefix}[{group}]");
println!(
"{list_prefix}{}",
config.color.stdout().group().paint(&format!("[{group}]"))
);
}
}

Expand Down

0 comments on commit d8d6b36

Please sign in to comment.