-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement and/or document flags (boolean option) with automatic sub-flags #12
Comments
I think I initially had reasons for not doing this but they all seem a bit weak now. I like the idea of doing this automatically. I personally find negations using |
an alternative would be negations using the uppercase short opt. |
What's the point of the inverted flags? I know they're used in some places, but they just seem confusing to me. Here's an actual example from
Obviously one of these must be the default, but I have no way of telling. Since one of them is implied by not specifying it, why do we need the flag at all? Here's another flag for the same command:
Since there is no corresponding |
with both, the default can be changed anytime ( and as the later option trumps, you can override stuff in aliases, … alias ls='ls -l' $ ls
drwxr-xr-x 1 phil users 314 6. Mär 12:12 bin/
$ ls -x
bin/ |
I've had a shot at an implementation of this to use as a discussion point. Take a look at 09bdead. Some points to discuss:
|
This has been implemented and will be in 2.0. Discussion on how to handle short flags can continue in #2 if necessary. |
flags are CLI parameters that take no argument. they usually have an inversion (
--no-<name>
or+g
)i guess #2 is about customization and short flags/options in general. this is about the automatic version of flag features.
flags with an automatic
--no-<name>
version would be cool.once short options/flags (#2) are there, an automatic flag inversion using
+g
would also be cool:The text was updated successfully, but these errors were encountered: