Skip to content

Commit

Permalink
fix(derive): Remove deprecated arg_enum attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 26, 2022
1 parent 6523666 commit b4b121d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion clap_complete/examples/completion-derive.rs
Expand Up @@ -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)]
Expand Down
1 change: 0 additions & 1 deletion clap_derive/src/parse.rs
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial_derive/04_01_enum.rs
Expand Up @@ -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,
}

Expand Down

0 comments on commit b4b121d

Please sign in to comment.