Better function names in bash completion

The new names make it easier to distinguish between helper functions and
functions that actually perform completion by modifying the global COMPOPT
variable.

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2015-12-22 12:27:56 +01:00 committed by Tibor Vass
parent 499d634f32
commit c227b6ac11
1 changed files with 86 additions and 86 deletions

View File

@ -56,7 +56,7 @@ __docker_q() {
docker ${host:+-H "$host"} ${config:+--config "$config"} 2>/dev/null "$@" docker ${host:+-H "$host"} ${config:+--config "$config"} 2>/dev/null "$@"
} }
__docker_containers_all() { __docker_complete_containers_all() {
local IFS=$'\n' local IFS=$'\n'
local containers=( $(__docker_q ps -aq --no-trunc) ) local containers=( $(__docker_q ps -aq --no-trunc) )
if [ "$1" ]; then if [ "$1" ]; then
@ -68,35 +68,35 @@ __docker_containers_all() {
COMPREPLY=( $(compgen -W "${names[*]} ${containers[*]}" -- "$cur") ) COMPREPLY=( $(compgen -W "${names[*]} ${containers[*]}" -- "$cur") )
} }
__docker_containers_running() { __docker_complete_containers_running() {
__docker_containers_all '.State.Running' __docker_complete_containers_all '.State.Running'
} }
__docker_containers_stopped() { __docker_complete_containers_stopped() {
__docker_containers_all 'not .State.Running' __docker_complete_containers_all 'not .State.Running'
} }
__docker_containers_pauseable() { __docker_complete_containers_pauseable() {
__docker_containers_all 'and .State.Running (not .State.Paused)' __docker_complete_containers_all 'and .State.Running (not .State.Paused)'
} }
__docker_containers_unpauseable() { __docker_complete_containers_unpauseable() {
__docker_containers_all '.State.Paused' __docker_complete_containers_all '.State.Paused'
} }
__docker_container_names() { __docker_complete_container_names() {
local containers=( $(__docker_q ps -aq --no-trunc) ) local containers=( $(__docker_q ps -aq --no-trunc) )
local names=( $(__docker_q inspect --format '{{.Name}}' "${containers[@]}") ) local names=( $(__docker_q inspect --format '{{.Name}}' "${containers[@]}") )
names=( "${names[@]#/}" ) # trim off the leading "/" from the container names names=( "${names[@]#/}" ) # trim off the leading "/" from the container names
COMPREPLY=( $(compgen -W "${names[*]}" -- "$cur") ) COMPREPLY=( $(compgen -W "${names[*]}" -- "$cur") )
} }
__docker_container_ids() { __docker_complete_container_ids() {
local containers=( $(__docker_q ps -aq) ) local containers=( $(__docker_q ps -aq) )
COMPREPLY=( $(compgen -W "${containers[*]}" -- "$cur") ) COMPREPLY=( $(compgen -W "${containers[*]}" -- "$cur") )
} }
__docker_images() { __docker_complete_images() {
local images_args="" local images_args=""
case "$DOCKER_COMPLETION_SHOW_IMAGE_IDS" in case "$DOCKER_COMPLETION_SHOW_IMAGE_IDS" in
@ -130,21 +130,21 @@ __docker_images() {
__ltrim_colon_completions "$cur" __ltrim_colon_completions "$cur"
} }
__docker_image_repos() { __docker_complete_image_repos() {
local repos="$(__docker_q images | awk 'NR>1 && $1 != "<none>" { print $1 }')" local repos="$(__docker_q images | awk 'NR>1 && $1 != "<none>" { print $1 }')"
COMPREPLY=( $(compgen -W "$repos" -- "$cur") ) COMPREPLY=( $(compgen -W "$repos" -- "$cur") )
} }
__docker_image_repos_and_tags() { __docker_complete_image_repos_and_tags() {
local reposAndTags="$(__docker_q images | awk 'NR>1 && $1 != "<none>" { print $1; print $1":"$2 }')" local reposAndTags="$(__docker_q images | awk 'NR>1 && $1 != "<none>" { print $1; print $1":"$2 }')"
COMPREPLY=( $(compgen -W "$reposAndTags" -- "$cur") ) COMPREPLY=( $(compgen -W "$reposAndTags" -- "$cur") )
__ltrim_colon_completions "$cur" __ltrim_colon_completions "$cur"
} }
__docker_containers_and_images() { __docker_complete_containers_and_images() {
__docker_containers_all __docker_complete_containers_all
local containers=( "${COMPREPLY[@]}" ) local containers=( "${COMPREPLY[@]}" )
__docker_images __docker_complete_images
COMPREPLY+=( "${containers[@]}" ) COMPREPLY+=( "${containers[@]}" )
} }
@ -157,15 +157,15 @@ __docker_networks() {
} }
__docker_complete_networks() { __docker_complete_networks() {
COMPREPLY=( $(compgen -W "$(__docker_complete_networks)" -- "$cur") ) COMPREPLY=( $(compgen -W "$(__docker_networks)" -- "$cur") )
} }
__docker_containers_in_network() { __docker_complete_containers_in_network() {
local containers=$(__docker_q network inspect -f '{{range $i, $c := .Containers}}{{$i}} {{$c.Name}} {{end}}' "$1") local containers=$(__docker_q network inspect -f '{{range $i, $c := .Containers}}{{$i}} {{$c.Name}} {{end}}' "$1")
COMPREPLY=( $(compgen -W "$containers" -- "$cur") ) COMPREPLY=( $(compgen -W "$containers" -- "$cur") )
} }
__docker_volumes() { __docker_complete_volumes() {
COMPREPLY=( $(compgen -W "$(__docker_q volume ls -q)" -- "$cur") ) COMPREPLY=( $(compgen -W "$(__docker_q volume ls -q)" -- "$cur") )
} }
@ -282,12 +282,12 @@ __docker_nospace() {
type compopt &>/dev/null && compopt -o nospace type compopt &>/dev/null && compopt -o nospace
} }
__docker_resolve_hostname() { __docker_complete_resolved_hostname() {
command -v host >/dev/null 2>&1 || return command -v host >/dev/null 2>&1 || return
COMPREPLY=( $(host 2>/dev/null "${cur%:}" | awk '/has address/ {print $4}') ) COMPREPLY=( $(host 2>/dev/null "${cur%:}" | awk '/has address/ {print $4}') )
} }
__docker_capabilities() { __docker_complete_capabilities() {
# The list of capabilities is defined in types.go, ALL was added manually. # The list of capabilities is defined in types.go, ALL was added manually.
COMPREPLY=( $( compgen -W " COMPREPLY=( $( compgen -W "
ALL ALL
@ -332,7 +332,7 @@ __docker_capabilities() {
" -- "$cur" ) ) " -- "$cur" ) )
} }
__docker_log_drivers() { __docker_complete_log_drivers() {
COMPREPLY=( $( compgen -W " COMPREPLY=( $( compgen -W "
awslogs awslogs
fluentd fluentd
@ -345,7 +345,7 @@ __docker_log_drivers() {
" -- "$cur" ) ) " -- "$cur" ) )
} }
__docker_log_driver_options() { __docker_complete_log_options() {
# see docs/reference/logging/index.md # see docs/reference/logging/index.md
local awslogs_options="awslogs-region awslogs-group awslogs-stream" local awslogs_options="awslogs-region awslogs-group awslogs-stream"
local fluentd_options="env fluentd-address labels tag" local fluentd_options="env fluentd-address labels tag"
@ -444,13 +444,13 @@ __docker_complete_log_driver_options() {
return 1 return 1
} }
__docker_log_levels() { __docker_complete_log_levels() {
COMPREPLY=( $( compgen -W "debug info warn error fatal" -- "$cur" ) ) COMPREPLY=( $( compgen -W "debug info warn error fatal" -- "$cur" ) )
} }
# a selection of the available signals that is most likely of interest in the # a selection of the available signals that is most likely of interest in the
# context of docker containers. # context of docker containers.
__docker_signals() { __docker_complete_signals() {
local signals=( local signals=(
SIGCONT SIGCONT
SIGHUP SIGHUP
@ -479,7 +479,7 @@ _docker_docker() {
return return
;; ;;
--log-level|-l) --log-level|-l)
__docker_log_levels __docker_complete_log_levels
return return
;; ;;
$(__docker_to_extglob "$global_options_with_args") ) $(__docker_to_extglob "$global_options_with_args") )
@ -508,7 +508,7 @@ _docker_attach() {
*) *)
local counter="$(__docker_pos_first_nonflag)" local counter="$(__docker_pos_first_nonflag)"
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_running __docker_complete_containers_running
fi fi
;; ;;
esac esac
@ -553,7 +553,7 @@ _docker_build() {
return return
;; ;;
--tag|-t) --tag|-t)
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
return return
;; ;;
$(__docker_to_extglob "$options_with_args") ) $(__docker_to_extglob "$options_with_args") )
@ -589,13 +589,13 @@ _docker_commit() {
local counter=$(__docker_pos_first_nonflag '--author|-a|--change|-c|--message|-m') local counter=$(__docker_pos_first_nonflag '--author|-a|--change|-c|--message|-m')
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
return return
fi fi
(( counter++ )) (( counter++ ))
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
return return
fi fi
;; ;;
@ -619,7 +619,7 @@ _docker_cp() {
_filedir _filedir
local files=( ${COMPREPLY[@]} ) local files=( ${COMPREPLY[@]} )
__docker_containers_all __docker_complete_containers_all
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) ) COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
local containers=( ${COMPREPLY[@]} ) local containers=( ${COMPREPLY[@]} )
@ -635,7 +635,7 @@ _docker_cp() {
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
if [ -e "$prev" ]; then if [ -e "$prev" ]; then
__docker_containers_all __docker_complete_containers_all
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) ) COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
__docker_nospace __docker_nospace
else else
@ -713,7 +713,7 @@ _docker_daemon() {
return return
;; ;;
--log-driver) --log-driver)
__docker_log_drivers __docker_complete_log_drivers
return return
;; ;;
--pidfile|-p|--tlscacert|--tlscert|--tlskey) --pidfile|-p|--tlscacert|--tlscert|--tlskey)
@ -759,11 +759,11 @@ _docker_daemon() {
return return
;; ;;
--log-level|-l) --log-level|-l)
__docker_log_levels __docker_complete_log_levels
return return
;; ;;
--log-opt) --log-opt)
__docker_log_driver_options __docker_complete_log_options
return return
;; ;;
$(__docker_to_extglob "$options_with_args") ) $(__docker_to_extglob "$options_with_args") )
@ -809,7 +809,7 @@ _docker_diff() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
fi fi
;; ;;
esac esac
@ -830,7 +830,7 @@ _docker_events() {
case "${words[$cword-2]}$prev=" in case "${words[$cword-2]}$prev=" in
*container=*) *container=*)
cur="${cur#=}" cur="${cur#=}"
__docker_containers_all __docker_complete_containers_all
return return
;; ;;
*event=*) *event=*)
@ -865,7 +865,7 @@ _docker_events() {
;; ;;
*image=*) *image=*)
cur="${cur#=}" cur="${cur#=}"
__docker_images __docker_complete_images
return return
;; ;;
esac esac
@ -889,7 +889,7 @@ _docker_exec() {
COMPREPLY=( $( compgen -W "--detach -d --help --interactive -i --privileged -t --tty -u --user" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--detach -d --help --interactive -i --privileged -t --tty -u --user" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_running __docker_complete_containers_running
;; ;;
esac esac
} }
@ -902,7 +902,7 @@ _docker_export() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
fi fi
;; ;;
esac esac
@ -923,7 +923,7 @@ _docker_history() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_images __docker_complete_images
fi fi
;; ;;
esac esac
@ -961,7 +961,7 @@ _docker_images() {
return return
;; ;;
*) *)
__docker_image_repos __docker_complete_image_repos
;; ;;
esac esac
} }
@ -985,7 +985,7 @@ _docker_import() {
(( counter++ )) (( counter++ ))
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
return return
fi fi
;; ;;
@ -1019,13 +1019,13 @@ _docker_inspect() {
*) *)
case $(__docker_value_of_option --type) in case $(__docker_value_of_option --type) in
'') '')
__docker_containers_and_images __docker_complete_containers_and_images
;; ;;
container) container)
__docker_containers_all __docker_complete_containers_all
;; ;;
image) image)
__docker_images __docker_complete_images
;; ;;
esac esac
esac esac
@ -1034,7 +1034,7 @@ _docker_inspect() {
_docker_kill() { _docker_kill() {
case "$prev" in case "$prev" in
--signal|-s) --signal|-s)
__docker_signals __docker_complete_signals
return return
;; ;;
esac esac
@ -1044,7 +1044,7 @@ _docker_kill() {
COMPREPLY=( $( compgen -W "--help --signal -s" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help --signal -s" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_running __docker_complete_containers_running
;; ;;
esac esac
} }
@ -1100,7 +1100,7 @@ _docker_logs() {
*) *)
local counter=$(__docker_pos_first_nonflag '--tail') local counter=$(__docker_pos_first_nonflag '--tail')
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
fi fi
;; ;;
esac esac
@ -1116,7 +1116,7 @@ _docker_network_connect() {
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_complete_networks __docker_complete_networks
elif [ $cword -eq $(($counter + 1)) ]; then elif [ $cword -eq $(($counter + 1)) ]; then
__docker_containers_running __docker_complete_containers_running
fi fi
;; ;;
esac esac
@ -1158,7 +1158,7 @@ _docker_network_disconnect() {
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_complete_networks __docker_complete_networks
elif [ $cword -eq $(($counter + 1)) ]; then elif [ $cword -eq $(($counter + 1)) ]; then
__docker_containers_in_network "$prev" __docker_complete_containers_in_network "$prev"
fi fi
;; ;;
esac esac
@ -1227,7 +1227,7 @@ _docker_pause() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_pauseable __docker_complete_containers_pauseable
fi fi
;; ;;
esac esac
@ -1241,7 +1241,7 @@ _docker_port() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
fi fi
;; ;;
esac esac
@ -1250,7 +1250,7 @@ _docker_port() {
_docker_ps() { _docker_ps() {
case "$prev" in case "$prev" in
--before|--since) --before|--since)
__docker_containers_all __docker_complete_containers_all
;; ;;
--filter|-f) --filter|-f)
COMPREPLY=( $( compgen -S = -W "ancestor exited id label name status" -- "$cur" ) ) COMPREPLY=( $( compgen -S = -W "ancestor exited id label name status" -- "$cur" ) )
@ -1265,17 +1265,17 @@ _docker_ps() {
case "${words[$cword-2]}$prev=" in case "${words[$cword-2]}$prev=" in
*ancestor=*) *ancestor=*)
cur="${cur#=}" cur="${cur#=}"
__docker_images __docker_complete_images
return return
;; ;;
*id=*) *id=*)
cur="${cur#=}" cur="${cur#=}"
__docker_container_ids __docker_complete_container_ids
return return
;; ;;
*name=*) *name=*)
cur="${cur#=}" cur="${cur#=}"
__docker_container_names __docker_complete_container_names
return return
;; ;;
*status=*) *status=*)
@ -1302,12 +1302,12 @@ _docker_pull() {
for arg in "${COMP_WORDS[@]}"; do for arg in "${COMP_WORDS[@]}"; do
case "$arg" in case "$arg" in
--all-tags|-a) --all-tags|-a)
__docker_image_repos __docker_complete_image_repos
return return
;; ;;
esac esac
done done
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
fi fi
;; ;;
esac esac
@ -1321,7 +1321,7 @@ _docker_push() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
fi fi
;; ;;
esac esac
@ -1335,7 +1335,7 @@ _docker_rename() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_all __docker_complete_containers_all
fi fi
;; ;;
esac esac
@ -1353,7 +1353,7 @@ _docker_restart() {
COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_all __docker_complete_containers_all
;; ;;
esac esac
} }
@ -1367,12 +1367,12 @@ _docker_rm() {
for arg in "${COMP_WORDS[@]}"; do for arg in "${COMP_WORDS[@]}"; do
case "$arg" in case "$arg" in
--force|-f) --force|-f)
__docker_containers_all __docker_complete_containers_all
return return
;; ;;
esac esac
done done
__docker_containers_stopped __docker_complete_containers_stopped
;; ;;
esac esac
} }
@ -1383,7 +1383,7 @@ _docker_rmi() {
COMPREPLY=( $( compgen -W "--force -f --help --no-prune" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--force -f --help --no-prune" -- "$cur" ) )
;; ;;
*) *)
__docker_images __docker_complete_images
;; ;;
esac esac
} }
@ -1470,7 +1470,7 @@ _docker_run() {
--add-host) --add-host)
case "$cur" in case "$cur" in
*:) *:)
__docker_resolve_hostname __docker_complete_resolved_hostname
return return
;; ;;
esac esac
@ -1480,7 +1480,7 @@ _docker_run() {
return return
;; ;;
--cap-add|--cap-drop) --cap-add|--cap-drop)
__docker_capabilities __docker_complete_capabilities
return return
;; ;;
--cidfile|--env-file|--label-file) --cidfile|--env-file|--label-file)
@ -1512,7 +1512,7 @@ _docker_run() {
case "$cur" in case "$cur" in
*:*) *:*)
cur="${cur#*:}" cur="${cur#*:}"
__docker_containers_running __docker_complete_containers_running
;; ;;
*) *)
COMPREPLY=( $( compgen -W 'host container:' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'host container:' -- "$cur" ) )
@ -1528,7 +1528,7 @@ _docker_run() {
*:*) *:*)
;; ;;
*) *)
__docker_containers_running __docker_complete_containers_running
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) ) COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
__docker_nospace __docker_nospace
;; ;;
@ -1536,18 +1536,18 @@ _docker_run() {
return return
;; ;;
--log-driver) --log-driver)
__docker_log_drivers __docker_complete_log_drivers
return return
;; ;;
--log-opt) --log-opt)
__docker_log_driver_options __docker_complete_log_options
return return
;; ;;
--net) --net)
case "$cur" in case "$cur" in
container:*) container:*)
local cur=${cur#*:} local cur=${cur#*:}
__docker_containers_all __docker_complete_containers_all
;; ;;
*) *)
COMPREPLY=( $( compgen -W "$(__docker_plugins Network) $(__docker_networks) container:" -- "$cur") ) COMPREPLY=( $( compgen -W "$(__docker_plugins Network) $(__docker_networks) container:" -- "$cur") )
@ -1591,7 +1591,7 @@ _docker_run() {
return return
;; ;;
--volumes-from) --volumes-from)
__docker_containers_all __docker_complete_containers_all
return return
;; ;;
$(__docker_to_extglob "$options_with_args") ) $(__docker_to_extglob "$options_with_args") )
@ -1608,7 +1608,7 @@ _docker_run() {
*) *)
local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) ) local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) )
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_images __docker_complete_images
fi fi
;; ;;
esac esac
@ -1627,7 +1627,7 @@ _docker_save() {
COMPREPLY=( $( compgen -W "--help --output -o" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help --output -o" -- "$cur" ) )
;; ;;
*) *)
__docker_images __docker_complete_images
;; ;;
esac esac
} }
@ -1652,7 +1652,7 @@ _docker_start() {
COMPREPLY=( $( compgen -W "--attach -a --help --interactive -i" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--attach -a --help --interactive -i" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_stopped __docker_complete_containers_stopped
;; ;;
esac esac
} }
@ -1663,7 +1663,7 @@ _docker_stats() {
COMPREPLY=( $( compgen -W "--all -a --help --no-stream" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--all -a --help --no-stream" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_running __docker_complete_containers_running
;; ;;
esac esac
} }
@ -1680,7 +1680,7 @@ _docker_stop() {
COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help --time -t" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_running __docker_complete_containers_running
;; ;;
esac esac
} }
@ -1694,13 +1694,13 @@ _docker_tag() {
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
return return
fi fi
(( counter++ )) (( counter++ ))
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags __docker_complete_image_repos_and_tags
return return
fi fi
;; ;;
@ -1715,7 +1715,7 @@ _docker_unpause() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_unpauseable __docker_complete_containers_unpauseable
fi fi
;; ;;
esac esac
@ -1729,7 +1729,7 @@ _docker_top() {
*) *)
local counter=$(__docker_pos_first_nonflag) local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_containers_running __docker_complete_containers_running
fi fi
;; ;;
esac esac
@ -1773,7 +1773,7 @@ _docker_volume_inspect() {
COMPREPLY=( $( compgen -W "--format -f --help" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--format -f --help" -- "$cur" ) )
;; ;;
*) *)
__docker_volumes __docker_complete_volumes
;; ;;
esac esac
} }
@ -1799,7 +1799,7 @@ _docker_volume_rm() {
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;; ;;
*) *)
__docker_volumes __docker_complete_volumes
;; ;;
esac esac
} }
@ -1829,7 +1829,7 @@ _docker_wait() {
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_all __docker_complete_containers_all
;; ;;
esac esac
} }