Skip to content

Commit ab9f606

Browse files
starsepo2sh
andcommitted
Remove clap-cargo. Change --help styling
Co-authored-by: Ossama Hjaji <ossama-hjaji@live.fr>
1 parent 87d4d5a commit ab9f606

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Cargo.lock

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ anyhow.workspace = true
3939
askalono = "0.5.0"
4040
byte-unit = "5.1.6"
4141
clap.workspace = true
42-
clap-cargo = "0.15.2"
4342
clap_complete = "4.5.55"
4443
crossbeam-channel = "0.5.15"
4544
gix = { version = "0.73.0", default-features = false, features = [

src/cli.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use crate::info::langs::language::{Language, LanguageType};
22
use crate::info::utils::info_field::InfoType;
33
use crate::ui::printer::SerializationFormat;
44
use anyhow::Result;
5+
use clap::builder::styling::AnsiColor;
56
use clap::builder::PossibleValuesParser;
7+
use clap::builder::Styles;
68
use clap::builder::TypedValueParser as _;
79
use clap::{value_parser, Args, Command, Parser, ValueHint};
810
use clap_complete::{generate, Generator, Shell};
@@ -20,9 +22,15 @@ use strum::IntoEnumIterator;
2022
const COLOR_RESOLUTIONS: [&str; 5] = ["16", "32", "64", "128", "256"];
2123
pub const NO_BOTS_DEFAULT_REGEX_PATTERN: &str = r"(?:-|\s)[Bb]ot$|\[[Bb]ot\]";
2224

25+
const STYLES: Styles = Styles::styled()
26+
.header(AnsiColor::Yellow.on_default())
27+
.usage(AnsiColor::Green.on_default())
28+
.literal(AnsiColor::Green.on_default())
29+
.placeholder(AnsiColor::Green.on_default());
30+
2331
#[derive(Clone, Debug, Parser, PartialEq, Eq)]
2432
#[command(version, about)]
25-
#[command(styles = clap_cargo::style::CLAP_STYLING)]
33+
#[command(styles = STYLES)]
2634
pub struct CliOptions {
2735
/// Run as if onefetch was started in <input> instead of the current working directory
2836
#[arg(default_value = ".", hide_default_value = true, value_hint = ValueHint::DirPath)]

0 commit comments

Comments
 (0)