You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: Expected `command` attribute instead of `arg`
--> src/lib.rs:13:7
|
13 | #[arg(flatten)]
| ^^^
error: could not compile `playground` due to previous error
Expected Behaviour
should compile, the derive reference (see here) says that flatten is a valid Arg attribute.
Additional Context
workaround is to use #[command(flatten)] or #[clap(flatten)] instead of #[arg(flatten)]. the former feels... incorrect? and iirc the latter is no longer recommended in favor of #[arg(...)].
Debug Output
No response
The text was updated successfully, but these errors were encountered:
Thanks for catching this! The documentation is updated in master.
#[command(flatten)] is the correct route to go as you are merging together information about the command, rather than setting attributes related to a specific Arg
Please complete the following tasks
Rust Version
1.65.0
Clap Version
4.0.26
Minimal reproducible code
Steps to reproduce the bug with the above code
build; playground link
Actual Behaviour
fails to compile with
Expected Behaviour
should compile, the derive reference (see here) says that
flatten
is a validArg
attribute.Additional Context
workaround is to use
#[command(flatten)]
or#[clap(flatten)]
instead of#[arg(flatten)]
. the former feels... incorrect? and iirc the latter is no longer recommended in favor of#[arg(...)]
.Debug Output
No response
The text was updated successfully, but these errors were encountered: