From 891c3a9d967e8a66059c19f14d510f3df30a771f Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 7 Oct 2017 13:26:43 +0200 Subject: [PATCH 1/2] Remove unused variable from bash completion Removes a copy & paste leftover. Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index dd2ef853b9..5d32b56a83 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -4505,7 +4505,7 @@ _docker_system() { info prune " - __docker_subcommands "$subcommands $aliases" && return + __docker_subcommands "$subcommands" && return case "$cur" in -*) From bb28364824ed2c7f9b39a015e6d18424814a7873 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 7 Oct 2017 13:25:49 +0200 Subject: [PATCH 2/2] Add bash completion for `docker trust` commands Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 5d32b56a83..cea120c2c9 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -4660,6 +4660,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 } @@ -4887,6 +4949,7 @@ _docker() { local experimental_commands=( checkpoint deploy + trust ) local commands=(${management_commands[*]} ${top_level_commands[*]})