Refactor CLI Dispatcher #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The current
src/cli.crdispatcher is tightly coupled to specific subcommand modules. This task involves refactoring it to allow new top-level commands to be added without modifying the central dispatcher.Expected outcome
New top-level commands can be registered with the central CLI dispatcher without touching
src/cli.cr.DocMachine::Cli#startadheres to the Open/Closed Principle.Current state
src/cli.crdirectly imports and callsadd_optionson each subcommand module. Adding a new command requires editingsrc/cli.cr.Technical details
add_optionssignatures should be maintained or migrated cleanly.Additional info
Local task id: a004f58.
a004f58 Refactor CLI Dispatcherto Refactor CLI Dispatcher