Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(derive): Remove deprecated arg_enum attribute #4127

Merged
merged 1 commit into from Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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