Optional, nested flatten gets ignored (nested ArgGroups are unsupported) #4697
Labels
A-derive
Area: #[derive]` macro API
A-parsing
Area: Parser's logic and needs it changed somehow.
C-enhancement
Category: Raise on the bar on expectations
E-hard
Call for participation: Experience needed to fix: Hard / a lot
Please complete the following tasks
Rust Version
rustc 1.67.0-nightly (e631891f7 2022-11-13)
Clap Version
4.1.4
Minimal reproducible code
Link to the Rust Playground
See #5435 for another variant of this problem
Steps to reproduce the bug with the above code
Simply run the code twice: first, with
args: Option<Main>
, and, second, withargs: Option<LoginArgs>
. Using the playground should be fine for testing.Comments in the
main()
function explain what is expected.The fact that
args
contains nestedflatten
seems to be the problem (?).Actual Behaviour
Even if the arguments defined in
Main
are all valid, i.e., all required arguments are specified, theargs
field isNone
.Expected Behaviour
I'd like the
args
field to beSome
in the first case, whenargs: Option<Main>
.Additional Context
I am aware of #3123 and #4350, but I am not sure whether what I observe it normal or not.
Debug Output
The text was updated successfully, but these errors were encountered: