From 50b1d6186b22aecb86becfe9945c11b0e6ddc1be Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Mon, 30 Sep 2024 10:22:46 -0700 Subject: [PATCH 1/3] feat: add color to the help text --- git-cliff/src/args.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index f62904a00e..2700b015a6 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -1,5 +1,7 @@ use clap::{ builder::{ + styling::AnsiColor, + Styles, TypedValueParser, ValueParserFactory, }, @@ -37,6 +39,12 @@ pub enum Sort { Newest, } +const STYLES: Styles = Styles::styled() + .header(AnsiColor::Blue.on_default().bold()) + .usage(AnsiColor::Blue.on_default().bold()) + .literal(AnsiColor::White.on_default()) + .placeholder(AnsiColor::Green.on_default()); + /// Command-line arguments to parse. #[derive(Debug, Parser)] #[command( @@ -56,6 +64,7 @@ pub enum Sort { next_help_heading = Some("OPTIONS"), disable_help_flag = true, disable_version_flag = true, + styles(STYLES), )] pub struct Opt { #[arg( From 02746a16d921e9337e82b77f571f6229c5d14abe Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Mon, 30 Sep 2024 15:05:37 -0700 Subject: [PATCH 2/3] fix: use colors closer to logo colors --- git-cliff/src/args.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index 2700b015a6..0b32a7e8ed 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -1,6 +1,9 @@ use clap::{ builder::{ - styling::AnsiColor, + styling::{ + Ansi256Color, + AnsiColor, + }, Styles, TypedValueParser, ValueParserFactory, @@ -40,10 +43,10 @@ pub enum Sort { } const STYLES: Styles = Styles::styled() - .header(AnsiColor::Blue.on_default().bold()) - .usage(AnsiColor::Blue.on_default().bold()) + .header(Ansi256Color(208).on_default().bold()) + .usage(Ansi256Color(208).on_default().bold()) .literal(AnsiColor::White.on_default()) - .placeholder(AnsiColor::Green.on_default()); + .placeholder(Ansi256Color(222).on_default()); /// Command-line arguments to parse. #[derive(Debug, Parser)] From 8efcc1bb05061a9aa56388f37776791213008893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Tue, 1 Oct 2024 19:33:35 +0300 Subject: [PATCH 3/3] style: update placeholder color --- git-cliff/src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index 0b32a7e8ed..6241624323 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -46,7 +46,7 @@ const STYLES: Styles = Styles::styled() .header(Ansi256Color(208).on_default().bold()) .usage(Ansi256Color(208).on_default().bold()) .literal(AnsiColor::White.on_default()) - .placeholder(Ansi256Color(222).on_default()); + .placeholder(AnsiColor::Green.on_default()); /// Command-line arguments to parse. #[derive(Debug, Parser)]