Refactor container subcommand dispatch #12
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?
title: Refactor Container Subcommand Dispatch in
src/container/cli.crdescription: Streamline the subcommand dispatch logic within
DocMachine::Container::Cli, moving away from a singlecasestatement that handles all subcommands.current_situation:
DocMachine::Container::Cli.add_optionsuses a largecasestatement within itsProc(Nil)block to dispatchpull,run,save, andloadsubcommands, including manualargs.shifthandling.expected_outcome: Each container subcommand is registered more cleanly, potentially using its own
OptionParserblock or by structuring thecontainercommand itself to properly delegate to dedicated command handlers forpull,run, etc.technical_details:
opts.on("container", ...)block insrc/container/cli.cr.opts.onblocks forpull,run,save,loaddirectly undercontainer.args.shift) is tightly coupled to the specific subcommand's parsing rather than a generic block.2fd2874 Refactor container subcommand dispatchto Refactor container subcommand dispatch