-
-
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
Command action removes last parameter value #1219
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The command name is not passed to the action handler, just the arguments for the command.
(Apologies for short replies, busy at moment but trying to give you quick help.) |
This comment has been minimized.
This comment has been minimized.
Missed this first time due to haste, but you are calling Try changing parse call to:
|
Related issue: #1209 |
Thanks, this solves the issue. I'm wanting to create multiple subcommands with their own actions but I can't really see the best way to do it, or how to do it at all in the readme. .command("add [id] [file]")
.command("update [id] [file]") If an action follows that, the subcommand gets passed in and I can work with it, but obviously the bug in this issue exists. |
If you just want multiple single level commands, then add them to the "program" instead of chaining them, like:
For nested commands you want to hang on to the new high level subcommand in a variable, and then add its own commands to that. Have a look at |
Warning of possible confusion, typo in example: I just noticed a Opened PR to fix typos: #1221 |
@shadowspawn thanks for the help! 💯 |
The workaround is to add an extra, unused argument until this is fixed.
The text was updated successfully, but these errors were encountered: