diff --git a/Cargo.toml b/Cargo.toml index 78a66ba..b251b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" [dependencies] anyhow = "1.0.75" -clap = { version = "4.4.8", features = ["derive", "env"] } +clap = { version = "4.4.8", features = ["derive", "env", "color"] } itertools = "0.11.0" lazy_static = "1.4.0" log = "0.4.20" diff --git a/src/app.rs b/src/app.rs index ac84f0a..b323b1b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,7 +1,19 @@ use crate::{api_client::CodSpeedAPIClient, auth, prelude::*, run}; -use clap::{Parser, Subcommand}; +use clap::{ + builder::{styling, Styles}, + Parser, Subcommand, +}; + +fn create_styles() -> Styles { + styling::Styles::styled() + .header(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD) + .usage(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD) + .literal(styling::AnsiColor::Magenta.on_default() | styling::Effects::BOLD) + .placeholder(styling::AnsiColor::Cyan.on_default()) +} #[derive(Parser, Debug)] +#[command(about = "The CodSpeed CLI tool", styles = create_styles())] pub struct Cli { /// The URL of the CodSpeed GraphQL API #[arg(