-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Create an inverseBoolFlag #1643
Conversation
@skelouse Can you add more tests for to exercise new interface ? |
…ct. Added more tests and solved logical issues.
Added more tests and removed the interface so that it acts, and can be used as any other flag type. |
This comment was marked as resolved.
This comment was marked as resolved.
@skelouse Also main is the default v3 branch now no need for v3-dev-main |
This comment was marked as resolved.
This comment was marked as resolved.
Good to go. Swapped in place for my original BoolWithInverse interface, and ran e2e tests on current project. |
What type of PR is this?
This is a new feature for handling IsSet of a BoolFlag by introducing an inverseFlag alongside it.
What this PR does / why we need it:
I made it here when trying to implement flags where the following commands are valid with a flag
--local
$ tau
local is not set, thus we prompt the user$ tau --local
local is set as true$ tau --local=false
local is set as falseI decided on an alternative where I take a flag, say
local
$ tau --local
local is set as true$ tau --no-local
local is set as falseWhich issue(s) this PR fixes:
Somewhat Fixes #424
Testing
I simply tested the basic IsSet, value and an error with:
Release Notes
TODO
Coverage
Options handling:
prefix- Negative Destination && CountThere are likely things I did not take into account which represent how a normal flag is expected to function.