cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags #6526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
relates to:
docker --badopthelp output #1850docker --badoptdoesn't show cli plugins #1813cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags
On Docker CLI versions before v28.0.0, using an unknown flag would print
the usage output, showing all available top-level flags and commands;
This output did not include plugin-commands, making the usage output
incomplete. That issue was fixed in cli@40a6cf7, which loaded all
available cli-plugins, so that a stub was created for printing the
plugin commands in the usage output. Similarly, cli@79a75da added
code to hide experimental commands and commands not supported by the
daemon.
However, since 28.0.0 (commit cli@f28fc7f), the usage output was
removed for this error, so loading plugins is no longer needed;
This patch removes the code added in cli@40a6cf7 and cli@79a75da.
With this patch, the output is still the same;
This function only handles flags defined by the CLI itself; invalid
flags for plugins are handled by the plugin itself, so are not
impacted;
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)