Skip to content
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 usage displayed incorrectly #1165

Closed
Flibio opened this issue Apr 1, 2016 · 2 comments
Closed

Command usage displayed incorrectly #1165

Flibio opened this issue Apr 1, 2016 · 2 comments
Assignees
Labels
system: command type: bug Something isn't working

Comments

@Flibio
Copy link
Contributor

Flibio commented Apr 1, 2016

Command arguments for sub-commands do not display at all in the help message when a user types in a sub-command without the required arguments. A detailed explanation can be found below.

Command /main has a sub-command set. The sub-command set has a required argument, called arg1. Running /main set, without submitting the required argument, displays an unhelpful usage message: Usage: /main set. It fails to display the required argument, arg1 in the usage message.

The command was created by implementing the CommandExecutor and registering a CommandSpec.

@liach
Copy link
Contributor

liach commented Apr 1, 2016

How does a SimpleDispatcher work? Does it work incorrectly in the same way?

@gabizou gabizou added system: command type: bug Something isn't working labels Apr 2, 2016
dualspiral added a commit that referenced this issue Dec 17, 2017
One of the long standing issues with the Command API is that subcommands don't give useful feedback if a command fails. The current implementation of the command system is difficult to solve this effectively with - this is a best effort. It isn't breaking, but in order to activate behaviour where a subcommand failing gives meaningful usage requires "childArgumentParseExceptionFallback" on the CommandSpec builder to be false. It defaults to true, the current behaviour.

Any plugin that doesn't use this method in the builder will get the old behaviour.

Fixes #1165, fixes #1272, fixes #1542, fixes #1647
dualspiral added a commit that referenced this issue Dec 17, 2017
One of the long standing issues with the Command API is that subcommands don't give useful feedback if a command fails. The current implementation of the command system is difficult to solve this effectively with - this is a best effort. It isn't breaking, but in order to activate behaviour where a subcommand failing gives meaningful usage requires "childArgumentParseExceptionFallback" on the CommandSpec builder to be false. It defaults to true, the current behaviour.

Any plugin that doesn't use this method in the builder will get the old behaviour.

Fixes #1165, fixes #1272, fixes #1542, fixes #1647
dualspiral added a commit that referenced this issue Dec 20, 2017
One of the long standing issues with the Command API is that subcommands don't give useful feedback if a command fails. The current implementation of the command system is difficult to solve this effectively with - this is a best effort. It isn't breaking, but in order to activate behaviour where a subcommand failing gives meaningful usage requires "childArgumentParseExceptionFallback" on the CommandSpec builder to be false. It defaults to true, the current behaviour.

Any plugin that doesn't use this method in the builder will get the old behaviour.

Fixes #1165, fixes #1272, fixes #1542, fixes #1647
dualspiral added a commit that referenced this issue Dec 20, 2017
One of the long standing issues with the Command API is that subcommands don't give useful feedback if a command fails. The current implementation of the command system is difficult to solve this effectively with - this is a best effort. It isn't breaking, but in order to activate behaviour where a subcommand failing gives meaningful usage requires "childArgumentParseExceptionFallback" on the CommandSpec builder to be false. It defaults to true, the current behaviour.

Any plugin that doesn't use this method in the builder will get the old behaviour.

Fixes #1165, fixes #1272, fixes #1542, fixes #1647
@dualspiral
Copy link
Contributor

In the latest SF for API 7 snapshot, I've added method childArgumentParseExceptionFallback to the CommandSpec. You need to set this to false to get the behaviour you expect above, I opted to make this a non-breaking change for API 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system: command type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants