Skip to content

cli: resolve subcommand path in container help#1587

Open
0xMH wants to merge 2 commits into
apple:mainfrom
0xMH:fix/1509-help-subcommand
Open

cli: resolve subcommand path in container help#1587
0xMH wants to merge 2 commits into
apple:mainfrom
0xMH:fix/1509-help-subcommand

Conversation

@0xMH
Copy link
Copy Markdown

@0xMH 0xMH commented May 22, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes #1509. The CLI's own help text tells users to run container help <subcommand>, but every form of that errored:

$ container help image delete
Error: 2 unexpected arguments: 'image', 'delete'
$ container help run
Error: Unexpected argument 'run'

The project's custom HelpCommand (registered so plugins show up in top-level help) had no positional @Argument, so swift-argument-parser routed help <x> to it and rejected the trailing tokens. Added a captured subcommand path, walked Application's subcommands + groupedSubcommands tree (matching commandName and aliases), and printed Application.helpMessage(for:) for the resolved target. Empty path keeps existing plugin-aware top-level help; unknown path throws ValidationError.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@0xMH 0xMH force-pushed the fix/1509-help-subcommand branch from 3133def to 965d320 Compare May 22, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: help subcommand doesn't work

1 participant