Refactor container subcommand dispatch #12

Open
opened 2025-11-19 13:16:57 +00:00 by glenux · 0 comments
Owner

title: Refactor Container Subcommand Dispatch in src/container/cli.cr
description: Streamline the subcommand dispatch logic within DocMachine::Container::Cli, moving away from a single case statement that handles all subcommands.
current_situation: DocMachine::Container::Cli.add_options uses a large case statement within its Proc(Nil) block to dispatch pull, run, save, and load subcommands, including manual args.shift handling.
expected_outcome: Each container subcommand is registered more cleanly, potentially using its own OptionParser block or by structuring the container command itself to properly delegate to dedicated command handlers for pull, run, etc.
technical_details:

  • Rework the opts.on("container", ...) block in src/container/cli.cr.
  • Explore defining nested opts.on blocks for pull, run, save, load directly under container.
  • Ensure argument consumption (args.shift) is tightly coupled to the specific subcommand's parsing rather than a generic block.

--- title: Refactor Container Subcommand Dispatch in `src/container/cli.cr` description: Streamline the subcommand dispatch logic within `DocMachine::Container::Cli`, moving away from a single `case` statement that handles all subcommands. current_situation: `DocMachine::Container::Cli.add_options` uses a large `case` statement within its `Proc(Nil)` block to dispatch `pull`, `run`, `save`, and `load` subcommands, including manual `args.shift` handling. expected_outcome: Each container subcommand is registered more cleanly, potentially using its own `OptionParser` block or by structuring the `container` command itself to properly delegate to dedicated command handlers for `pull`, `run`, etc. technical_details: - Rework the `opts.on("container", ...)` block in `src/container/cli.cr`. - Explore defining nested `opts.on` blocks for `pull`, `run`, `save`, `load` directly under `container`. - Ensure argument consumption (`args.shift`) is tightly coupled to the specific subcommand's parsing rather than a generic block. ---
glenux changed title from 2fd2874 Refactor container subcommand dispatch to Refactor container subcommand dispatch 2025-11-19 13:18:49 +00:00
glenux added this to the By Status project 2025-11-19 18:02:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: glenux/docmachine-cli#12
No description provided.