Merge pull request #609 from albers/completion-trust

Add bash completion for `docker trust` commands
This commit is contained in:
Vincent Demeester 2017-10-31 11:24:35 +01:00 committed by GitHub
commit d0197347ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 64 additions and 1 deletions

View File

@ -4510,7 +4510,7 @@ _docker_system() {
info
prune
"
__docker_subcommands "$subcommands $aliases" && return
__docker_subcommands "$subcommands" && return
case "$cur" in
-*)
@ -4665,6 +4665,68 @@ _docker_tag() {
_docker_image_tag
}
_docker_trust() {
local subcommands="
revoke
sign
view
"
__docker_subcommands "$subcommands" && return
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
;;
esac
}
_docker_trust_revoke() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --yes -y" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images
fi
;;
esac
}
_docker_trust_sign() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images
fi
;;
esac
}
_docker_trust_view() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images
fi
;;
esac
}
_docker_unpause() {
_docker_container_unpause
}
@ -4892,6 +4954,7 @@ _docker() {
local experimental_commands=(
checkpoint
deploy
trust
)
local commands=(${management_commands[*]} ${top_level_commands[*]})