Rename helper function in bash completion for consistency
Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
parent
fceaae95b5
commit
93e43b42be
1 changed files with 8 additions and 8 deletions
|
@ -435,10 +435,10 @@ __docker_append_to_completions() {
|
|||
COMPREPLY=( ${COMPREPLY[@]/%/"$1"} )
|
||||
}
|
||||
|
||||
# __docker_is_experimental tests whether the currently configured Docker daemon
|
||||
# runs in experimental mode. If so, the function exits with 0 (true).
|
||||
# __docker_daemon_is_experimental tests whether the currently configured Docker
|
||||
# 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).
|
||||
__docker_is_experimental() {
|
||||
__docker_daemon_is_experimental() {
|
||||
[ "$(__docker_q version -f '{{.Server.Experimental}}')" = "true" ]
|
||||
}
|
||||
|
||||
|
@ -906,7 +906,7 @@ _docker_docker() {
|
|||
*)
|
||||
local counter=$( __docker_pos_first_nonflag "$(__docker_to_extglob "$global_options_with_args")" )
|
||||
if [ $cword -eq $counter ]; then
|
||||
__docker_is_experimental && commands+=(${experimental_commands[*]})
|
||||
__docker_daemon_is_experimental && commands+=(${experimental_commands[*]})
|
||||
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
|
@ -1955,7 +1955,7 @@ _docker_daemon() {
|
|||
}
|
||||
|
||||
_docker_deploy() {
|
||||
__docker_is_experimental && _docker_stack_deploy
|
||||
__docker_daemon_is_experimental && _docker_stack_deploy
|
||||
}
|
||||
|
||||
_docker_diff() {
|
||||
|
@ -2052,7 +2052,7 @@ _docker_image_build() {
|
|||
--quiet -q
|
||||
--rm
|
||||
"
|
||||
__docker_is_experimental && boolean_options+="--squash"
|
||||
__docker_daemon_is_experimental && boolean_options+="--squash"
|
||||
|
||||
local all_options="$options_with_args $boolean_options"
|
||||
|
||||
|
@ -3633,7 +3633,7 @@ _docker_stack() {
|
|||
_docker_stack_deploy() {
|
||||
case "$prev" in
|
||||
--bundle-file)
|
||||
if __docker_is_experimental ; then
|
||||
if __docker_daemon_is_experimental ; then
|
||||
_filedir dab
|
||||
return
|
||||
fi
|
||||
|
@ -3647,7 +3647,7 @@ _docker_stack_deploy() {
|
|||
case "$cur" in
|
||||
-*)
|
||||
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" ) )
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue