Skip to content

Commit c18b5de

Browse files
committed
Add basic bash completion for manifest command family
Signed-off-by: Harald Albers <github@albersweb.de>
1 parent 948f6af commit c18b5de

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

contrib/completion/bash/docker

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ _docker_docker() {
11461146
*)
11471147
local counter=$( __docker_pos_first_nonflag "$(__docker_to_extglob "$global_options_with_args")" )
11481148
if [ "$cword" -eq "$counter" ]; then
1149+
__docker_client_is_experimental && commands+=(${experimental_client_commands[*]})
11491150
__docker_server_is_experimental && commands+=(${experimental_server_commands[*]})
11501151
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
11511152
fi
@@ -3839,6 +3840,71 @@ _docker_swarm_update() {
38393840
esac
38403841
}
38413842

3843+
_docker_manifest() {
3844+
local subcommands="
3845+
annotate
3846+
create
3847+
inspect
3848+
push
3849+
"
3850+
__docker_subcommands "$subcommands" && return
3851+
3852+
case "$cur" in
3853+
-*)
3854+
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
3855+
;;
3856+
*)
3857+
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
3858+
;;
3859+
esac
3860+
}
3861+
3862+
_docker_manifest_annotate() {
3863+
case "$prev" in
3864+
--arch|--os|--os-features|--variant)
3865+
return
3866+
;;
3867+
esac
3868+
3869+
case "$cur" in
3870+
-*)
3871+
COMPREPLY=( $( compgen -W "--arch --help --os --os-features --variant" -- "$cur" ) )
3872+
;;
3873+
*)
3874+
;;
3875+
esac
3876+
}
3877+
3878+
_docker_manifest_create() {
3879+
case "$cur" in
3880+
-*)
3881+
COMPREPLY=( $( compgen -W "--amend -a --help --insecure" -- "$cur" ) )
3882+
;;
3883+
*)
3884+
;;
3885+
esac
3886+
}
3887+
3888+
_docker_manifest_inspect() {
3889+
case "$cur" in
3890+
-*)
3891+
COMPREPLY=( $( compgen -W "--help --insecure --verbose -v" -- "$cur" ) )
3892+
;;
3893+
*)
3894+
;;
3895+
esac
3896+
}
3897+
3898+
_docker_manifest_push() {
3899+
case "$cur" in
3900+
-*)
3901+
COMPREPLY=( $( compgen -W "--help --insecure --purge -p" -- "$cur" ) )
3902+
;;
3903+
*)
3904+
;;
3905+
esac
3906+
}
3907+
38423908
_docker_node() {
38433909
local subcommands="
38443910
demote
@@ -5096,6 +5162,10 @@ _docker() {
50965162
wait
50975163
)
50985164

5165+
local experimental_client_commands=(
5166+
manifest
5167+
)
5168+
50995169
local experimental_server_commands=(
51005170
checkpoint
51015171
deploy

0 commit comments

Comments
 (0)