-
-
Notifications
You must be signed in to change notification settings - Fork 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
May Parser::update_from
not deny the presence of flags (option of type bool
) ?
#4501
Comments
I wonder how well we can detect this case as users can overwrite defaults. We can check for various combinations of |
Oh, I guess the simpler thing is for |
The next question is if that would be disruptive enough for anyones workflow to be either a minor compatibility break (reserved for clap v4.X.0) or a major compatibility break (reserved for clap vX.0.0) |
|
So a minor compatibility break would be OK :) |
Minor or major is not a matter of how many people are impacted but by a characterization of how it affects applications that might or might not be relying on the behavior. And honestly, I keep wondering if we should just remove |
The semantic of |
@epage |
I'm not sold that
The part that was missing was someone stepping through the analysis requested earlier
to determine if this is a major incompatibility, minor incompatibility, or just a bug fix. |
@epage |
Not to rush you, but I was wondering if you are still working on this? |
I triaged this but am not actively working on it. The next step is
|
Is it a good idea to collect users' opinion about |
To be clear, the analysis I'm referring to is in this comment: #4501 (comment) Removing |
Theoretically, this is a major compatibility break, either keep with internal changes or remove it. |
Please complete the following tasks
Clap Version
4.0.26
Describe your use case
I'm seeking a way to merge default options coming from environment variable and runtime options.
Even though the method
Parser::update_from
cannot distinguish the difference betweenNone
and default value, it is the right way. I usedunwrap_or
with custom default value to bypass this feature but found it very troublesome to deal with flags.Here is the example code:
Run with flag:
Output:
The present flag is denied by
update_from
without--boolean
.Describe the solution you'd like
I wish
update_from
to not overwrite the presence of flags,true
values should be kept during updating.Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: