-
Notifications
You must be signed in to change notification settings - Fork 422
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
Default value of option in repeated subcommand not applied correctly #1381
Labels
Milestone
Comments
Merged
remkop
added a commit
that referenced
this issue
Jun 8, 2021
MarkoMackic
pushed a commit
to MarkoMackic/picocli
that referenced
this issue
Oct 17, 2021
MarkoMackic
added a commit
to MarkoMackic/picocli
that referenced
this issue
Oct 17, 2021
This reverts commit 8e2088e.
MarkoMackic
added a commit
to MarkoMackic/picocli
that referenced
this issue
Oct 17, 2021
This reverts commit 8e2088e.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Say I have the following command in which mysubcommand is a repeatable subcommand:
mycommand mysubcommand param mysubcommand -t test param
In this case the first subcommand's default value for the -t option is not set correctly by Interpreter.applyDefaultValues(). The reason seems to be that parsing the second subcommand adds the -t option to the set of initialized arguments:
Set<ArgSpec> initialized
. This set is then also used when setting the default values of the first subcommand. ThusapplyDefaultValues()
falsely believes it is already initialized.The text was updated successfully, but these errors were encountered: