-
-
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
Add check for implies
argument type
#1852
Comments
(Another reason I think this an easy mistake is that many of the option methods do take strings, eg |
Commander does not have a lot of runtime checks on the parameters, but I am happy to consider adding checks or improving behaviour for routines that are easy to get wrong. (A past one that was added was #1655.) |
Makes sense, thanks! |
impies
argument typeimplies
argument type
For interest, we added support in |
@shadowspawn Very nice! |
Shipped #1854 in 10.0.1 Thanks @canopy-js-user |
@shadowspawn thank you! |
Hi there, twice I've accidentally written a line of code like this:
Ie, I want the
--port
option to imply the boolean flagsync
. However,sync
is expecting an object of implied key-value pairs. However, as is, this fails silently and converts the string/array'sync'
into an object, and merges it with the rest of the options:I'm proposing a check that the argument to
implies
is an object and not a string, and if it is a string, error. (Or, interpret the string as the name of a boolean option that the programmer is asserting should be true.)Thanks!
The text was updated successfully, but these errors were encountered: