Skip to content

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Jul 7, 2025

fixes #2495

Use additionalHelp annotation to set Buildx experimental command hint to avoid duplicated commands description in the output.

Before:

$ docker buildx
Extended build capabilities with BuildKit

Usage:  docker buildx [OPTIONS] COMMAND

Extended build capabilities with BuildKit

Options:
      --builder string   Override the configured builder instance
  -D, --debug            Enable debug logging

Management Commands:
  history     Commands to work on build records
  imagetools  Commands to work on images in registry

Commands:
  bake        Build from a file
  build       Start a build
  create      Create a new builder instance
  dial-stdio  Proxy current stdio streams to builder instance
  du          Disk usage
  inspect     Inspect current builder instance
  ls          List builder instances
  prune       Remove build cache
  rm          Remove one or more builder instances
  stop        Stop builder instance
  use         Set the current builder instance
  version     Show buildx version information

Run 'docker buildx COMMAND --help' for more information on a command.

Experimental commands and flags are hidden. Set BUILDX_EXPERIMENTAL=1 to show them.

After:

$ docker buildx
Usage:  docker buildx [OPTIONS] COMMAND

Extended build capabilities with BuildKit

Options:
      --builder string   Override the configured builder instance
  -D, --debug            Enable debug logging

Management Commands:
  history     Commands to work on build records
  imagetools  Commands to work on images in registry

Commands:
  bake        Build from a file
  build       Start a build
  create      Create a new builder instance
  dial-stdio  Proxy current stdio streams to builder instance
  du          Disk usage
  inspect     Inspect current builder instance
  ls          List builder instances
  prune       Remove build cache
  rm          Remove one or more builder instances
  stop        Stop builder instance
  use         Set the current builder instance
  version     Show buildx version information

Run 'docker buildx COMMAND --help' for more information on a command.

Experimental commands and flags are hidden. Set BUILDX_EXPERIMENTAL=1 to show them.

Also in standalone mode we are not using the plugin usage template so we need to continue to append the hint message to current help template in standalone.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max added this to the v0.26.0 milestone Jul 7, 2025
@crazy-max crazy-max force-pushed the cmd-fix-duplicated-usage branch from bf22868 to b6cd86e Compare July 7, 2025 10:11
@crazy-max crazy-max requested a review from tonistiigi July 7, 2025 11:42
@crazy-max crazy-max marked this pull request as ready for review July 7, 2025 11:42
@tonistiigi tonistiigi merged commit 39ee904 into docker:master Jul 10, 2025
197 of 202 checks passed
@crazy-max crazy-max deleted the cmd-fix-duplicated-usage branch July 10, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command short description duplicated in output
2 participants