-
-
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
Pass unknown also as a second argument to the command:* event #921
Comments
In order to fix the issue, we need to pass the unknown parameter to the while emitting the Line 656 in 68545af
|
Have you got a small example program? (I do see the warning for unknown flags in my program which has subcommands, but looks like you have just an optional argument and options and no subcommands?) |
Attached is a PR that does the suggested behavior and adjustment of tests. I'm a little hesitant about it though because it breaks the existing default behavior of ignoring unknown options, instead resulting in an error. While this is the desired behavior for my programs, others might be relying on the silent default handling of unknown options. |
I have reproduced this, and realised it is a duplicate of #561. Closing in favour of that open issue. Thank you for your contributions. |
After deeper analysis I discovered that there are different behaviours depending on whether there is an action handler attached to the program. #965 is targeting the case when there is an action handler, and original report in #561 covering no action handler. Not sure which case applies to |
We are trying to use this awesome library to handle command line arguments and flags in Taiko.
There seems to be an issue related to unknown flags. When we provide the
js file
argument and pass an unknown flag commander does not complain about that. But when we pass only unknown flag without arguments commander prints a nice message that provides flag was invalid.It would be great if the commander complains about the unknown flags even if they are passed after arguments.
The text was updated successfully, but these errors were encountered: