From 4b6e9c3c1bbb98fb297028243df7a116f7384faa Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 13 Jan 2023 20:43:18 -0600 Subject: [PATCH] style(cli): Resolve clap deprecations --- src/bin/typos-cli/args.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bin/typos-cli/args.rs b/src/bin/typos-cli/args.rs index 1857b39..ba4ea3e 100644 --- a/src/bin/typos-cli/args.rs +++ b/src/bin/typos-cli/args.rs @@ -173,11 +173,11 @@ impl FileArgs { } #[derive(Debug, clap::Args)] -#[clap(rename_all = "kebab-case")] +#[command(rename_all = "kebab-case")] pub(crate) struct ConfigArgs { - #[clap(flatten)] + #[command(flatten)] walk: WalkArgs, - #[clap(flatten)] + #[command(flatten)] overrides: FileArgs, } @@ -192,46 +192,46 @@ impl ConfigArgs { } #[derive(Debug, clap::Args)] -#[clap(rename_all = "kebab-case")] +#[command(rename_all = "kebab-case")] pub(crate) struct WalkArgs { /// Ignore files & directories matching the glob. - #[clap(long, name = "GLOB")] + #[arg(long, value_name = "GLOB")] exclude: Vec, /// Search hidden files and directories. - #[clap(long, overrides_with("no_hidden"))] + #[arg(long, overrides_with("no_hidden"))] hidden: bool, - #[clap(long, overrides_with("hidden"), hide = true)] + #[arg(long, overrides_with("hidden"), hide = true)] no_hidden: bool, /// Don't respect ignore files. - #[clap(long, overrides_with("ignore"))] + #[arg(long, overrides_with("ignore"))] no_ignore: bool, - #[clap(long, overrides_with("no_ignore"), hide = true)] + #[arg(long, overrides_with("no_ignore"), hide = true)] ignore: bool, /// Don't respect .ignore files. - #[clap(long, overrides_with("ignore_dot"))] + #[arg(long, overrides_with("ignore_dot"))] no_ignore_dot: bool, - #[clap(long, overrides_with("no_ignore_dot"), hide = true)] + #[arg(long, overrides_with("no_ignore_dot"), hide = true)] ignore_dot: bool, /// Don't respect global ignore files. - #[clap(long, overrides_with("ignore_global"))] + #[arg(long, overrides_with("ignore_global"))] no_ignore_global: bool, - #[clap(long, overrides_with("no_ignore_global"), hide = true)] + #[arg(long, overrides_with("no_ignore_global"), hide = true)] ignore_global: bool, /// Don't respect ignore files in parent directories. - #[clap(long, overrides_with("ignore_parent"))] + #[arg(long, overrides_with("ignore_parent"))] no_ignore_parent: bool, - #[clap(long, overrides_with("no_ignore_parent"), hide = true)] + #[arg(long, overrides_with("no_ignore_parent"), hide = true)] ignore_parent: bool, /// Don't respect ignore files in vcs directories. - #[clap(long, overrides_with("ignore_vcs"))] + #[arg(long, overrides_with("ignore_vcs"))] no_ignore_vcs: bool, - #[clap(long, overrides_with("no_ignore_vcs"), hide = true)] + #[arg(long, overrides_with("no_ignore_vcs"), hide = true)] ignore_vcs: bool, }