-
-
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
On and off switches are not working #108
Comments
hmm does having both make sense? The logic I have for boolean flags is that if you have |
The reason for that is that these switches are used to overwrite a configuration file. Depending on what is in the configuration file we need to be able to turn the option on or off. |
ah I see, yeah that's a little tricky with the defaults I guess hmm |
What about the following .option('--auto-watch', 'Description') generates two options, one .option('--no-auto-watch', 'Description') alone it just behaves as it does right now. |
I have a problem with the logic here
sets My logic would be that
would set
would set I understand that there should be some way to find if the option was specified or not, but I don't think there's any way to tell that such argument is optional or should be always set. But, again, specifying both would solve the problem.
would check for these rules :
|
Hehe, even mocha needs this. It has both // --no-colors
if (!program.colors) mocha.useColors(false);
// --colors
if (~process.argv.indexOf('--colors') ||
~process.argv.indexOf('-c')) {
mocha.useColors(true);
} (That hack is buggy, too, since |
Any progress on this one? |
Still hitting this in 2017.. |
I have an open PR that should fix this: #795. Please review and comment! |
This issue will be resolved when v3.0.0 is released. Available now as a prerelease. See #1001 |
Support for combined Closing second oldest open issue. Woop! |
If I try
I get the following output:
That should not happen. I need the first one to be
true
. Also if I try to set a default value oftrue
that won't work either.The text was updated successfully, but these errors were encountered: