diff --git a/Cargo.lock b/Cargo.lock index e29cab9bd..31313eba9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -439,16 +439,6 @@ dependencies = [ "clap_derive", ] -[[package]] -name = "clap-cargo" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d546f0e84ff2bfa4da1ce9b54be42285767ba39c688572ca32412a09a73851e5" -dependencies = [ - "anstyle", - "clap", -] - [[package]] name = "clap_builder" version = "4.5.43" @@ -2716,7 +2706,6 @@ dependencies = [ "askalono", "byte-unit", "clap", - "clap-cargo", "clap_complete", "criterion", "crossbeam-channel", diff --git a/Cargo.toml b/Cargo.toml index 5b161edc3..6285e30ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,6 @@ anyhow.workspace = true askalono = "0.5.0" byte-unit = "5.1.6" clap.workspace = true -clap-cargo = "0.15.2" clap_complete = "4.5.55" crossbeam-channel = "0.5.15" gix = { version = "0.73.0", default-features = false, features = [ diff --git a/src/cli.rs b/src/cli.rs index a75863950..a830079d8 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,9 @@ use crate::info::langs::language::{Language, LanguageType}; use crate::info::utils::info_field::InfoType; use crate::ui::printer::SerializationFormat; use anyhow::Result; +use clap::builder::styling::AnsiColor; use clap::builder::PossibleValuesParser; +use clap::builder::Styles; use clap::builder::TypedValueParser as _; use clap::{value_parser, Args, Command, Parser, ValueHint}; use clap_complete::{generate, Generator, Shell}; @@ -20,9 +22,15 @@ use strum::IntoEnumIterator; const COLOR_RESOLUTIONS: [&str; 5] = ["16", "32", "64", "128", "256"]; pub const NO_BOTS_DEFAULT_REGEX_PATTERN: &str = r"(?:-|\s)[Bb]ot$|\[[Bb]ot\]"; +const STYLES: Styles = Styles::styled() + .header(AnsiColor::Yellow.on_default()) + .usage(AnsiColor::Green.on_default()) + .literal(AnsiColor::Green.on_default()) + .placeholder(AnsiColor::Green.on_default()); + #[derive(Clone, Debug, Parser, PartialEq, Eq)] #[command(version, about)] -#[command(styles = clap_cargo::style::CLAP_STYLING)] +#[command(styles = STYLES)] pub struct CliOptions { /// Run as if onefetch was started in instead of the current working directory #[arg(default_value = ".", hide_default_value = true, value_hint = ValueHint::DirPath)]