Improved the Dispatcher to work with default global args and support extra ones in the future (CRAFT-565).
Metadata
Current evaluation
Merged Dispatcher improvements for default global arguments and future extras. Refactored naming, relocated help functions, and prepared code for craft-cli extraction. Approved and merged.
Suggested action: —
No scores available.
Issue body
This is a small improvement (the dispatcher supporting the "extra global args", for which tests were added) and two groups of code moved around (no tests changes needed, as there is no functionality changes really). All part of the plan of splitting this functionality into `craft-cli` lib.
The code moved around or changed is:
- better names! `_Global` transformed into `GlobalArgument` as this will be part of the lib's public API, and `GLOBAL_ARGS` transformed into `_DEFAULT_GLOBAL_ARGS` which will be part of the internal lib's functionality
- moved the functionality of three help-related functions to be part of the Dispatcher (as they need to access/use the "final global args")
Note that the "project dir" global arg is still "default", but will be moved to be "extra" when the Dispatcher is isolated from the configuration loading.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged Dispatcher improvements for default global arguments and future extras. Refactored naming, relocated help functions, and prepared code for craft-cli extraction. Approved and merged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged Dispatcher improvements to support default and future extra global arguments. Refactored naming for public and internal APIs, relocated help functions, and prepared code for extraction into the craft-cli library. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged Dispatcher updates to handle default global arguments and support future extras. Renamed components for API clarity, relocated help functions, and refactored code to prepare extraction into the craft-cli library. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #106 refactor: drop _Dispatcher | craft-application | merged | Merged a refactoring that drops the internal _Dispatcher class. Updates craft-cli minimum version to 2.3.0 to leverage its standard Dispatcher.parsed_args() method. Approved by two reviewers, passed CI, and merged successfully. | |
| #56 Simplify the Dispatcher usage | craft-cli | open | Refactor request to simplify craft-cli Dispatcher usage by adding a simple_run helper or implicit pre_parse_args/load_command calls before run. Triaged by maintainer, synced to internal ticket CRAFT-4790, but no code change implemented yet. | |
| #58 Support for a default command in Dispatcher (CRAFT-760). | craft-cli | merged | Merged after approval, adding default command support to the Dispatcher (CRAFT-760). Includes documentation and modifies three files with 79 additions and 25 deletions. |