Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash: update trust completions #944

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -4713,9 +4713,9 @@ _docker_tag() {

_docker_trust() {
local subcommands="
inspect
revoke
sign
view
"
__docker_subcommands "$subcommands" && return

Expand All @@ -4729,10 +4729,10 @@ _docker_trust() {
esac
}

_docker_trust_revoke() {
_docker_trust_inspect() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --yes -y" -- "$cur" ) )
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff view on github looks a bit odd here, because the order of commands was changed (they're alphabetical, so order changed due to view -> inspect)

COMPREPLY=( $( compgen -W "--help --pretty" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
Expand All @@ -4743,29 +4743,29 @@ _docker_trust_revoke() {
esac
}

_docker_trust_sign() {
_docker_trust_revoke() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --local" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--help --yes -y" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images --force-tag --id
__docker_complete_images --repo --tag
fi
;;
esac
}

_docker_trust_view() {
_docker_trust_sign() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--help --local" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images --repo --tag
__docker_complete_images --force-tag --id
fi
;;
esac
Expand Down Expand Up @@ -4947,6 +4947,7 @@ _docker() {
stack
swarm
system
trust
volume
)

Expand Down Expand Up @@ -4999,7 +5000,6 @@ _docker() {
local experimental_commands=(
checkpoint
deploy
trust
)

local commands=(${management_commands[*]} ${top_level_commands[*]})
Expand Down