Show container usage when missing subcommand #18

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

title: Show container usage when missing subcommand
description: Invoking ./bin/docmachine container currently prints “No container command specified…” but omits the usage instructions and list of available subcommands, forcing the user to re-run with --help.
current_situation: DocMachine::Container::Cli#add_options (src/container/cli.cr:12-83) enqueues a command that raises DocMachine::CliError when no subcommand arguments remain (line 79), but doesn’t print the container-specific usage banner or help text beforehand. Contrast this with main CLI --help, which shows the subcommand list. The container command should display the same instructions automatically when invoked without arguments, aligning with ADR-CLI expectations.
expected_outcome:

  • Running ./bin/docmachine container should show the container usage banner and subcommand list before raising an error (or exit 0 with help message).
  • Tests cover the zero-argument scenario, ensuring usage text is emitted.
    technical_details:
  • Reuse opts.banner / opts.help or manually print the string defined earlier in add_options when no subcommand is provided.
  • Consider raising DocMachine::HelpRequested with the container-specific usage text for consistency with the main CLI.

--- title: Show container usage when missing subcommand description: Invoking `./bin/docmachine container` currently prints “No container command specified…” but omits the usage instructions and list of available subcommands, forcing the user to re-run with `--help`. current_situation: `DocMachine::Container::Cli#add_options` (src/container/cli.cr:12-83) enqueues a command that raises `DocMachine::CliError` when no subcommand arguments remain (line 79), but doesn’t print the container-specific usage banner or help text beforehand. Contrast this with main CLI `--help`, which shows the subcommand list. The container command should display the same instructions automatically when invoked without arguments, aligning with ADR-CLI expectations. expected_outcome: - Running `./bin/docmachine container` should show the container usage banner and subcommand list before raising an error (or exit 0 with help message). - Tests cover the zero-argument scenario, ensuring usage text is emitted. technical_details: - Reuse `opts.banner` / `opts.help` or manually print the string defined earlier in `add_options` when no subcommand is provided. - Consider raising `DocMachine::HelpRequested` with the container-specific usage text for consistency with the main CLI. ---
glenux changed title from c4d6e12 Show container usage when missing subcommand to Show container usage when missing subcommand 2025-11-19 13:26:37 +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#18
No description provided.