Rename helper function in bash completion for consistency

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-01-25 10:33:09 +01:00 committed by Tibor Vass
parent 3494343b71
commit a88fb3678d
1 changed files with 8 additions and 8 deletions

View File

@ -449,10 +449,10 @@ __docker_append_to_completions() {
COMPREPLY=( ${COMPREPLY[@]/%/"$1"} ) COMPREPLY=( ${COMPREPLY[@]/%/"$1"} )
} }
# __docker_is_experimental tests whether the currently configured Docker daemon # __docker_daemon_is_experimental tests whether the currently configured Docker
# runs in experimental mode. If so, the function exits with 0 (true). # daemon runs in experimental mode. If so, the function exits with 0 (true).
# Otherwise, or if the result cannot be determined, the exit value is 1 (false). # Otherwise, or if the result cannot be determined, the exit value is 1 (false).
__docker_is_experimental() { __docker_daemon_is_experimental() {
[ "$(__docker_q version -f '{{.Server.Experimental}}')" = "true" ] [ "$(__docker_q version -f '{{.Server.Experimental}}')" = "true" ]
} }
@ -920,7 +920,7 @@ _docker_docker() {
*) *)
local counter=$( __docker_pos_first_nonflag "$(__docker_to_extglob "$global_options_with_args")" ) local counter=$( __docker_pos_first_nonflag "$(__docker_to_extglob "$global_options_with_args")" )
if [ $cword -eq $counter ]; then if [ $cword -eq $counter ]; then
__docker_is_experimental && commands+=(${experimental_commands[*]}) __docker_daemon_is_experimental && commands+=(${experimental_commands[*]})
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) ) COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
fi fi
;; ;;
@ -1969,7 +1969,7 @@ _docker_daemon() {
} }
_docker_deploy() { _docker_deploy() {
__docker_is_experimental && _docker_stack_deploy __docker_daemon_is_experimental && _docker_stack_deploy
} }
_docker_diff() { _docker_diff() {
@ -2066,7 +2066,7 @@ _docker_image_build() {
--quiet -q --quiet -q
--rm --rm
" "
__docker_is_experimental && boolean_options+="--squash" __docker_daemon_is_experimental && boolean_options+="--squash"
local all_options="$options_with_args $boolean_options" local all_options="$options_with_args $boolean_options"
@ -3647,7 +3647,7 @@ _docker_stack() {
_docker_stack_deploy() { _docker_stack_deploy() {
case "$prev" in case "$prev" in
--bundle-file) --bundle-file)
if __docker_is_experimental ; then if __docker_daemon_is_experimental ; then
_filedir dab _filedir dab
return return
fi fi
@ -3661,7 +3661,7 @@ _docker_stack_deploy() {
case "$cur" in case "$cur" in
-*) -*)
local options="--compose-file -c --help --with-registry-auth" local options="--compose-file -c --help --with-registry-auth"
__docker_is_experimental && options+=" --bundle-file" __docker_daemon_is_experimental && options+=" --bundle-file"
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
;; ;;
esac esac