Skip to content

feat: add help for cli plugin#1068

Merged
jglogan merged 2 commits into
apple:mainfrom
tico88612:feat/help-command
Apr 5, 2026
Merged

feat: add help for cli plugin#1068
jglogan merged 2 commits into
apple:mainfrom
tico88612:feat/help-command

Conversation

@tico88612
Copy link
Copy Markdown
Contributor

@tico88612 tico88612 commented Jan 18, 2026

Type of Change

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

Motivation and Context

Fix #387

Here's how I see the issue #387, though I'm not entirely sure.

Testing

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

Comment thread Sources/ContainerCommands/Application.swift Outdated
@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Jan 22, 2026

@tico88612 Could you also rebase onto the current main? Our action runners got updated and you'll need the new workflows for your PR to build. Thanks!

@tico88612
Copy link
Copy Markdown
Contributor Author

@jglogan I will update this later

@tico88612
Copy link
Copy Markdown
Contributor Author

@jglogan I added the test and rebased to main.

@tico88612 tico88612 force-pushed the feat/help-command branch from 03a64d0 to 390a847 Compare March 8, 2026 16:10
@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Apr 3, 2026

@tico88612 Looking at this one again...rather than preprocessing the arguments, could you try:

  • Creating a HelpCommand.swift for help and add it to the subcommands of Application.swift?
  • HelpCommand.swift would just call try? await Application.createPluginLoader() to get a plugin loader, and Application.printModifiedHelpText(pluginLoader)

I don't know if anyone's tried overriding the default help command this way but it'll keep all the nonstandard arg munging a bit simpler, and then the --help output should match the help output exactly.

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
@tico88612 tico88612 force-pushed the feat/help-command branch from 390a847 to 752c97d Compare April 4, 2026 05:24
@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Apr 5, 2026

Niiiice! Thanks!

% container help
Warning! Running debug build. Performance may be degraded.
OVERVIEW: A container platform for macOS
USAGE: container [--debug] <subcommand>
OPTIONS:
  --debug                 Enable debug output [environment: CONTAINER_DEBUG]
  --version               Show the version.
  -h, --help              Show help information.
CONTAINER SUBCOMMANDS:
  create                  Create a new container
  delete, rm              Delete one or more containers
  exec                    Run a new command in a running container
  export                  Export a container's filesystem as a tar archive
  inspect                 Display information about one or more containers
  kill                    Kill or signal one or more running containers
  list, ls                List running containers
  logs                    Fetch container logs
  run                     Run a container
  start                   Start a container
  stats                   Display resource usage statistics for containers
  stop                    Stop one or more running containers
  prune                   Remove all stopped containers
IMAGE SUBCOMMANDS:
  build                   Build an image from a Dockerfile or Containerfile
  image, i                Manage images
  registry, r             Manage registry logins
VOLUME SUBCOMMANDS:
  volume, v               Manage container volumes
OTHER SUBCOMMANDS:
  builder                 Manage an image builder instance
  network, n              Manage container networks
  system, s               Manage system components
PLUGINS:
...

@jglogan jglogan merged commit ef99389 into apple:main Apr 5, 2026
3 checks passed
@tico88612 tico88612 deleted the feat/help-command branch April 5, 2026 02:58
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]: container --help shows an installed CLI plugin but container help does not.

2 participants