Skip to content

Commit b928e66

Browse files
committed
change clap styles
1 parent 73c7a73 commit b928e66

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ rust-version = "1.74.1"
99
[dependencies]
1010
anyhow = "1.0.86"
1111
clap = { version = "4.5.13", features = ["cargo", "derive", "wrap_help"] }
12+
clap-cargo = { version = "0.14.1", features = ["clap"] }
1213
clap_complete = "4.5.14"
1314
termsize = "0.1.9"
1415

@@ -22,7 +23,6 @@ unsafe_code = "forbid"
2223
ambiguous_glob_imports = "deny"
2324
ambiguous_glob_reexports = "deny"
2425
nonstandard_style = { level = "deny", priority = -1 }
25-
dead_code = "deny"
2626
improper_ctypes = "deny"
2727
missing_debug_implementations = "deny"
2828
no_mangle_generic_items = "deny"

src/main.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::{
1818
version = env!("PKG_VERSION"),
1919
long_version = env!("PKG_LONG_VERSION"),
2020
author = clap::crate_authors!("\n"),
21-
styles = styles(),
21+
styles = clap_cargo::style::CLAP_STYLING,
2222
help_template = HELP,
2323
)]
2424
struct Opt {
@@ -205,15 +205,6 @@ const HELP: &str = "\
205205
{name} {version} {author-with-newline}
206206
";
207207

208-
fn styles() -> clap::builder::Styles {
209-
use clap::builder::styling::AnsiColor;
210-
clap::builder::Styles::styled()
211-
.usage(AnsiColor::Green.on_default())
212-
.header(AnsiColor::Yellow.on_default())
213-
.literal(AnsiColor::Green.on_default())
214-
.placeholder(AnsiColor::Green.on_default())
215-
}
216-
217208
fn print_completions(gen: Option<clap_complete::Shell>) -> bool {
218209
if let Some(gen) = gen {
219210
let mut cmd = Opt::command();

0 commit comments

Comments
 (0)