diff --git a/examples/derive_ref/README.md b/examples/derive_ref/README.md index 7beef4d2..1b97baf4 100644 --- a/examples/derive_ref/README.md +++ b/examples/derive_ref/README.md @@ -128,6 +128,9 @@ attributes. These correspond to a `clap::Command` which is used for both top-level parsers and when defining subcommands. +**Raw attributes:** Any [`Command` method](https://docs.rs/clap/latest/clap/type.Command.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. +- e.g. `#[clap(arg_required_else_help(true))]` would translate to `cmd.arg_required_else_help(true)` + **Magic attributes:** - `name = `: `clap::Command::name` - When not present: [crate `name`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field) (`Parser` container), variant name (`Subcommand` variant) @@ -163,13 +166,13 @@ And for `Subcommand` variants: - `external_subcommand`: `clap::Command::allow_external_subcommand(true)` - Variant must be either `Variant(Vec)` or `Variant(Vec)` -**Raw attributes:** Any [`Command` method](https://docs.rs/clap/latest/clap/type.Command.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. -- e.g. `#[clap(arg_required_else_help(true))]` would translate to `cmd.arg_required_else_help(true)` - ### Arg Attributes These correspond to a `clap::Arg`. +**Raw attributes:** Any [`Arg` method](https://docs.rs/clap/latest/clap/struct.Arg.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. +- e.g. `#[clap(max_values(3))]` would translate to `arg.max_values(3)` + **Magic attributes**: - `name = `: `clap::Arg::new` - When not present: case-converted field name is used @@ -216,9 +219,6 @@ These correspond to a `clap::Arg`. - Requires `std::convert::Into` or `#[clap(arg_enum)]` - Without ``, relies on `Default::default()` -**Raw attributes:** Any [`Arg` method](https://docs.rs/clap/latest/clap/struct.Arg.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. -- e.g. `#[clap(max_values(3))]` would translate to `arg.max_values(3)` - ### Arg Enum Attributes - `rename_all = `: Override default field / variant name case conversion for `PossibleValue::new` @@ -229,15 +229,15 @@ These correspond to a `clap::Arg`. These correspond to a `clap::PossibleValue`. +**Raw attributes:** Any [`PossibleValue` method](https://docs.rs/clap/latest/clap/struct.PossibleValue.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. +- e.g. `#[clap(alias("foo"))]` would translate to `pv.alias("foo")` + **Magic attributes**: - `name = `: `clap::PossibleValue::new` - When not present: case-converted field name is used - `help = `: `clap::PossibleValue::help` - When not present: [Doc comment summary](#doc-comments) -**Raw attributes:** Any [`PossibleValue` method](https://docs.rs/clap/latest/clap/struct.PossibleValue.html) can also be used as an attribute, see [Terminology](#terminology) for syntax. -- e.g. `#[clap(alias("foo"))]` would translate to `pv.alias("foo")` - ## Arg Types `clap` assumes some intent based on the type used: