You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contrib/completion/zsh: add CLI plugin completion support
Previously, the zsh completion script could list Docker CLI plugin
commands (compose, buildx, etc.) via __docker_commands(), but had no
handler in __docker_subcommand() for them. This meant that while
"docker <TAB>" would show "compose" as an option, "docker compose <TAB>"
produced no completions.
Add support for CLI plugin completion by invoking the plugin binary's
Cobra __completeNoDesc protocol, similar to how the bash completion
already handles this.
The implementation handles all six Cobra ShellCompDirective values:
- Error (1): abort completion
- NoSpace (2): suppress trailing space
- NoFileComp (4): suppress file fallback
- FilterFileExt (8): filter files by extension
- FilterDirs (16): complete directories only
- KeepOrder (32): preserve completion ordering
Additionally:
- Plugin paths are cached using zsh's _store_cache/_retrieve_cache
with the same 1-hour TTL policy as __docker_commands
- ActiveHelp markers are displayed as informational text
- Literal colons in completions are escaped for _describe
- --flag=<TAB> completions propagate the flag prefix correctly
- Words are truncated to CURRENT for backward cursor movement
Closes: #6231
Signed-off-by: Artem <colinsergesen@gmail.com>
0 commit comments