Skip to content

Commit

Permalink
feat: update CLI style
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jul 15, 2024
1 parent 8beb1c8 commit 3832706
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 13 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 3832706

Please sign in to comment.