fix(derive): Remove deprecated arg_enum attribute

This commit is contained in:
Ed Page 2022-08-26 13:29:10 -05:00
parent 6523666a73
commit b4b121d3a4
4 changed files with 3 additions and 3 deletions

View file

@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- *(env)* Parse `--help` and `--version` like any `ArgAction::SetTrue` flag (#3776)
- *(derive)* Changed the default for arguments from `parse` to `value_parser`., removing `parse` support
- *(derive)* `subcommand_required(true).arg_required_else_help(true)` is set instead of `SubcommandRequiredElseHelp` (#3280)
- *(derive)* Remove `arg_enum` attribute in favor of `value_enum`
### Compatibility

View file

@ -26,7 +26,7 @@ use std::path::PathBuf;
)]
struct Opt {
/// If provided, outputs the completion file for given shell
#[clap(long = "generate", arg_enum)]
#[clap(long = "generate", value_enum)]
generator: Option<Shell>,
// Showcasing all possible ValueHints:
#[clap(long, value_hint = ValueHint::Unknown)]

View file

@ -155,7 +155,6 @@ impl Parse for ClapAttr {
"action" => Ok(Action(name)),
"env" => Ok(Env(name)),
"flatten" => Ok(Flatten(name)),
"arg_enum" => Ok(ValueEnum(name)),
"value_enum" => Ok(ValueEnum(name)),
"from_global" => Ok(FromGlobal(name)),
"subcommand" => Ok(Subcommand(name)),

View file

@ -4,7 +4,7 @@ use clap::{Parser, ValueEnum};
#[clap(author, version, about, long_about = None)]
struct Cli {
/// What mode to run the program in
#[clap(arg_enum)]
#[clap(value_enum)]
mode: Mode,
}