Skip to content

Commit d3ed81f

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

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

contrib/completion/bash/docker

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ _docker_docker() {
11041104
*)
11051105
local counter=$( __docker_pos_first_nonflag "$(__docker_to_extglob "$global_options_with_args")" )
11061106
if [ "$cword" -eq "$counter" ]; then
1107+
__docker_client_is_experimental && commands+=(${experimental_client_commands[*]})
11071108
__docker_server_is_experimental && commands+=(${experimental_server_commands[*]})
11081109
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
11091110
fi
@@ -3797,6 +3798,71 @@ _docker_swarm_update() {
37973798
esac
37983799
}
37993800

3801+
_docker_manifest() {
3802+
local subcommands="
3803+
annotate
3804+
create
3805+
inspect
3806+
push
3807+
"
3808+
__docker_subcommands "$subcommands" && return
3809+
3810+
case "$cur" in
3811+
-*)
3812+
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
3813+
;;
3814+
*)
3815+
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
3816+
;;
3817+
esac
3818+
}
3819+
3820+
_docker_manifest_annotate() {
3821+
case "$prev" in
3822+
--arch|--os|--os-features|--variant)
3823+
return
3824+
;;
3825+
esac
3826+
3827+
case "$cur" in
3828+
-*)
3829+
COMPREPLY=( $( compgen -W "--arch --help --os --os-features --variant" -- "$cur" ) )
3830+
;;
3831+
*)
3832+
;;
3833+
esac
3834+
}
3835+
3836+
_docker_manifest_create() {
3837+
case "$cur" in
3838+
-*)
3839+
COMPREPLY=( $( compgen -W "--amend -a --help --insecure" -- "$cur" ) )
3840+
;;
3841+
*)
3842+
;;
3843+
esac
3844+
}
3845+
3846+
_docker_manifest_inspect() {
3847+
case "$cur" in
3848+
-*)
3849+
COMPREPLY=( $( compgen -W "--help --insecure --verbose -v" -- "$cur" ) )
3850+
;;
3851+
*)
3852+
;;
3853+
esac
3854+
}
3855+
3856+
_docker_manifest_push() {
3857+
case "$cur" in
3858+
-*)
3859+
COMPREPLY=( $( compgen -W "--help --insecure --purge -p" -- "$cur" ) )
3860+
;;
3861+
*)
3862+
;;
3863+
esac
3864+
}
3865+
38003866
_docker_node() {
38013867
local subcommands="
38023868
demote
@@ -5028,6 +5094,10 @@ _docker() {
50285094
wait
50295095
)
50305096

5097+
local experimental_client_commands=(
5098+
manifest
5099+
)
5100+
50315101
local experimental_server_commands=(
50325102
checkpoint
50335103
deploy

0 commit comments

Comments
 (0)