-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(cli): cobra cli args library to support negation [no-] flags #6025
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
base: master
Are you sure you want to change the base?
feat(cli): cobra cli args library to support negation [no-] flags #6025
Conversation
Signed-off-by: ivan katliarchuk <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
Signed-off-by: ivan katliarchuk <[email protected]>
Pull Request Test Coverage Report for Build 20211224035Details
💛 - Coveralls |
|
@ivankatliarchuk 🤔 Why introduce such complexity ? I mean,
We may also introduce a breaking change, where users need to switch their flags from current |
Co-authored-by: Michel Loiseleur <[email protected]>
|
Agree it adds a bit of complexity. One of the ideas is to keep behaviour as is, and move flag changes to upstream library at some point, if they accept changes. If we going to move away from negative flags - yes it will simplify things for us. For users, semantics is going to change for every boolean flag. Like they need to explicitly specify true|false. Nothing wrong with this approach. I leave it for reviewer to decide. |
What does it do ?
external-dns/pkg/apis/externaldns/types.go
Line 502 in 690259f
NoOptDefVal, no--foo=truesyntax. spf13/pflag#214Follow-ups:
--helpgenerate similar output as for kingpin but for cobra, aka add--[no-]aws-zone-match-parentkind of ouputexternal-dns/internal/gen/docs/flags/main.go
Line 65 in 690259f
Motivation
Follow-up for #5836
Relates #5379
More