|
177 | 177 | //! - `external_subcommand`: [`Command::allow_external_subcommand(true)`][crate::Command::allow_external_subcommands]
|
178 | 178 | //! - Variant must be either `Variant(Vec<String>)` or `Variant(Vec<OsString>)`
|
179 | 179 | //!
|
| 180 | +//! And for [`Args`][crate::Args] fields: |
| 181 | +//! - `flatten`: Delegates to the field for more arguments (must implement [`Args`][crate::Args]) |
| 182 | +//! - Only [`next_help_heading`][crate::Command::next_help_heading] can be used with `flatten`. See |
| 183 | +//! [clap-rs/clap#3269](https://github.com/clap-rs/clap/issues/3269) for why |
| 184 | +//! arg attributes are not generally supported. |
| 185 | +//! - **Tip:** Though we do apply a flattened [`Args`][crate::Args]'s Parent Command Attributes, this |
| 186 | +//! makes reuse harder. Generally prefer putting the cmd attributes on the |
| 187 | +//! [`Parser`][crate::Parser] or on the flattened field. |
| 188 | +//! - `subcommand`: Delegates definition of subcommands to the field (must implement |
| 189 | +//! [`Subcommand`][crate::Subcommand]) |
| 190 | +//! - When `Option<T>`, the subcommand becomes optional |
| 191 | +//! |
180 | 192 | //! ### ArgGroup Attributes
|
181 | 193 | //!
|
182 | 194 | //! These correspond to the [`ArgGroup`][crate::ArgGroup] which is implicitly created for each
|
|
214 | 226 | //! - `env [= <str>]`: [`Arg::env`][crate::Arg::env] (needs [`env` feature][crate::_features] enabled)
|
215 | 227 | //! - When not present: no env set
|
216 | 228 | //! - Without `<str>`: defaults to the case-converted field name
|
217 |
| -//! - `flatten`: Delegates to the field for more arguments (must implement [`Args`][crate::Args]) |
218 |
| -//! - Only [`next_help_heading`][crate::Command::next_help_heading] can be used with `flatten`. See |
219 |
| -//! [clap-rs/clap#3269](https://github.com/clap-rs/clap/issues/3269) for why |
220 |
| -//! arg attributes are not generally supported. |
221 |
| -//! - **Tip:** Though we do apply a flattened [`Args`][crate::Args]'s Parent Command Attributes, this |
222 |
| -//! makes reuse harder. Generally prefer putting the cmd attributes on the |
223 |
| -//! [`Parser`][crate::Parser] or on the flattened field. |
224 |
| -//! - `subcommand`: Delegates definition of subcommands to the field (must implement |
225 |
| -//! [`Subcommand`][crate::Subcommand]) |
226 |
| -//! - When `Option<T>`, the subcommand becomes optional |
227 | 229 | //! - `from_global`: Read a [`Arg::global`][crate::Arg::global] argument (raw attribute), regardless of what subcommand you are in
|
228 | 230 | //! - `value_enum`: Parse the value using the [`ValueEnum`][crate::ValueEnum]
|
229 | 231 | //! - `skip [= <expr>]`: Ignore this field, filling in with `<expr>`
|
|
0 commit comments