Skip to content

Commit

Permalink
feat(cli): Add colored output to --help
Browse files Browse the repository at this point in the history
  • Loading branch information
donovanglover committed Oct 26, 2023
1 parent e89ef8c commit c9be9b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use clap::builder::styling::{AnsiColor, Effects, Styles};
use clap::Parser;

const LONG_ABOUT: &str = "
Expand All @@ -24,8 +25,16 @@ available here[5].
[5]: https://github.com/donovanglover/hyprdim
";

fn styles() -> Styles {
Styles::styled()
.header(AnsiColor::Red.on_default() | Effects::BOLD)
.usage(AnsiColor::Red.on_default() | Effects::BOLD)
.literal(AnsiColor::Blue.on_default() | Effects::BOLD)
.placeholder(AnsiColor::Green.on_default())
}

#[derive(Parser)]
#[command(author, version, about, long_about = LONG_ABOUT)]
#[command(author, version, about, long_about = LONG_ABOUT, styles = styles())]
pub struct Cli {
/// A value from 0 (no dim) to 1 (maximum dim)
///
Expand Down

0 comments on commit c9be9b0

Please sign in to comment.