Skip to content

Commit

Permalink
feat(args): add color to the help text (#897)
Browse files Browse the repository at this point in the history
* feat: add color to the help text

* fix: use colors closer to logo colors

* style: update placeholder color

---------

Co-authored-by: Orhun Parmaksız <[email protected]>
  • Loading branch information
joshka and orhun authored Oct 1, 2024
1 parent bfe9beb commit f423484
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions git-cliff/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
use clap::{
builder::{
styling::{
Ansi256Color,
AnsiColor,
},
Styles,
TypedValueParser,
ValueParserFactory,
},
Expand Down Expand Up @@ -37,6 +42,12 @@ pub enum Sort {
Newest,
}

const STYLES: Styles = Styles::styled()
.header(Ansi256Color(208).on_default().bold())
.usage(Ansi256Color(208).on_default().bold())
.literal(AnsiColor::White.on_default())
.placeholder(AnsiColor::Green.on_default());

/// Command-line arguments to parse.
#[derive(Debug, Parser)]
#[command(
Expand All @@ -56,6 +67,7 @@ pub enum Sort {
next_help_heading = Some("OPTIONS"),
disable_help_flag = true,
disable_version_flag = true,
styles(STYLES),
)]
pub struct Opt {
#[arg(
Expand Down

0 comments on commit f423484

Please sign in to comment.