-
-
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
[Bug] Unexpected arguments ignored #2149
Comments
You can make this an error by calling
You can explicitly collect the remaining arguments by declaring the last one as variadic like `.argument('[more-args...]'). Also, all of the arguments are available using |
Oh, I'm sorry I didn't find these beforehand. 😅
I'd like to request this to be default though, for security reasons. Thanks |
I originally intended excess arguments to be an error by default, but made it opt-in for the first release to reduce breakage at the time:
On a related note, there was an in-depth discussion during the development of I am leaning towards making |
A prerelease is available for v13. The release is tagged as next and can be installed with:
|
Hi,
When passing more arguments to a command than it expects, the command is executed without error, receiving only the expected arguments.
It would be nice to throw an error instead, preventing potantially wrong actions/results unforeseen by the user.
One particular case is when an argument is a name/title/label, in which the user may include spaces while forgetting quotes.
On the other hand, I wonder if it would be possible, when said argument is the last (or only) one, to optionally put everything automatically in it, kinda like the spread operator in JS (but still outputting a string) ?
Thanks
The text was updated successfully, but these errors were encountered: