Transformed the help management to be implemented not using a command (CRAFT-542).
Metadata
Current evaluation
Merged refactoring centralizing help management during initial argument pre-parsing instead of a standalone command. Adds ProvideHelpException for better guidance. Approved by two reviewers and merged with 181 additions and 153 deletions across four files.
Suggested action: —
No scores available.
Issue body
This has several benefits:
- The help handling is now more straightforward
- The COMMAND_GROUPS constant does not include anything related to help anymore (more app isolation ot a future lib)
- We're able to provide better messages when help was "requested wrong" (e.g. with too many parameters or an incorrect command); IMO this is very important, as we're able to guide the user better in a situation when they're a little lost (there is a reason they are asking for help...)
- All help handling happens on the "initial args pre-parsing", and not one part there and one part when the command is run (this is transparent for the user, but useful for when Dispatcher will be in other lib)
We have only one minor drawbacks: 'help' itself, as a command, is not listed in the "basic commands group" anymore.
Note I added a ProvideHelpException exception to interrupt the normal flow of execution and finish the process providing a guiding text when **help was requested correctly**. This was a simple way to achieve this branch targets without moving a lot of code around, it may change in the future to be more simple when we isolate the Dispatcher further.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged refactoring centralizing help management during initial argument pre-parsing instead of a standalone command. Adds ProvideHelpException for better guidance. Approved by two reviewers and merged with 181 additions and 153 deletions across four files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged refactoring moving help management to initial argument pre-parsing. Uses ProvideHelpException to handle requests and improve error messaging. Centralizes logic, removes help from COMMAND_GROUPS, and aids dispatcher isolation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged refactoring that replaces the dedicated help command with initial argument pre-parsing logic. Uses ProvideHelpException to manage output, improving user guidance and app isolation, though the help command is no longer listed in basic commands. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #154 Improved short help messages. | charmcraft | merged | Merged improvements to short help messages for commands and parameters, updating output per UX suggestions. Approved by two reviewers, passed CI, and modified eight files as part of a broader help overhaul. | |
| #111 Added the option of showing the help for a command in markdown format (CRAFT-1207). | craft-cli | merged | Merged. Added markdown format support for command help output (CRAFT-1207). Approved by one reviewer with zero unresolved comments. Changes span three files with 452 additions and 68 deletions. |