-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Optional, nested flatten gets ignored (nested ArgGroups are unsupported) #4697
Open
2 tasks done
Tracked by
#3165
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
Comments
epage
changed the title
bug(derive): option of nested flatten does not work as expected
Option of nested flatten does not work as expected
Feb 8, 2023
epage
added
E-hard
Call for participation: Experience needed to fix: Hard / a lot
A-parsing
Area: Parser's logic and needs it changed somehow.
labels
Feb 8, 2023
This was previously a task list item in #3165, so I've updated it to point to this issue |
epage
added
C-enhancement
Category: Raise on the bar on expectations
A-derive
Area: #[derive]` macro API
and removed
C-bug
Category: Updating dependencies
labels
Feb 8, 2023
epage
changed the title
Option of nested flatten does not work as expected
Optional, nested flatten gets ignored (nested ArgGroups are unsupported)
Feb 8, 2023
Thanks for the update! I don't think I know Clap well enough to help with #3165, but I hope someone will :D |
2 tasks
2 tasks
indygreg
added a commit
to indygreg/apple-platform-rs
that referenced
this issue
Nov 16, 2023
…ning ones The multiple levels of nesting combined with Option<T> were conspiring to prevent CLI arguments from getting processed. I believe this is clap-rs/clap#4697 but am not 100% sure. We mitigate the problem by moving the session initialization fields into the main key struct so we have a single level of argument nesting. As part of this we remote `--remote-signer` and instead infer remote signing from presence of a session initialization argument. We also make the server URL optional to prevent the struct from having any populated fields by default.
2 tasks
juanibiapina
added a commit
to juanibiapina/sub
that referenced
this issue
Jun 15, 2024
With the previous setup it was running into a clap bug: clap-rs/clap#4697
This was referenced Aug 29, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: