correct sort order in new bash completions

The completion for the new `docker service`, `docker swarm` and
`docker node` command families were partly added in non-alphabetical
order.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 19753ec84d)
This commit is contained in:
Harald Albers 2016-06-18 09:52:02 -07:00 committed by Tibor Vass
parent b8b938c61c
commit a4e3415235

View file

@ -1591,6 +1591,82 @@ _docker_service_create() {
esac
}
_docker_service_inspect() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--format -f --help --pretty -p" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_list() {
_docker_service_ls
}
_docker_service_ls() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-f --filter --help --quiet -q" -- "$cur" ) )
;;
esac
}
_docker_service_remove() {
_docker_service_rm
}
_docker_service_rm() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_scale() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(__docker_services $1)" -- "$cur") )
__docker_nospace
;;
esac
}
_docker_service_tasks() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve -n" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_update() {
local options_with_args="
--arg
@ -1640,89 +1716,13 @@ _docker_service_update() {
esac
}
_docker_service_inspect() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--format -f --help --pretty -p" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_tasks() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--all -a --filter -f --help --no-resolve -n" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_remove() {
_docker_service_rm
}
_docker_service_rm() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_complete_services
esac
}
_docker_service_list() {
_docker_service_ls
}
_docker_service_ls() {
case "$prev" in
--format|-f)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-f --filter --help --quiet -q" -- "$cur" ) )
;;
esac
}
_docker_service_scale() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(__docker_services $1)" -- "$cur") )
__docker_nospace
;;
esac
}
_docker_swarm() {
local subcommands="
init
join
update
leave
inspect
join
leave
update
"
__docker_subcommands "$subcommands" && return
@ -1744,6 +1744,14 @@ _docker_swarm_init() {
esac
}
_docker_swarm_inspect() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--format --help" -- "$cur" ) )
;;
esac
}
_docker_swarm_join() {
case "$cur" in
-*)
@ -1752,6 +1760,14 @@ _docker_swarm_join() {
esac
}
_docker_swarm_leave() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--force --help" -- "$cur" ) )
;;
esac
}
_docker_swarm_update() {
case "$prev" in
--auto-accept|--cert-expiry|--dispatcher-heartbeat|--secret|--task-history-limit)
@ -1766,22 +1782,6 @@ _docker_swarm_update() {
esac
}
_docker_swarm_leave() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--force --help" -- "$cur" ) )
;;
esac
}
_docker_swarm_inspect() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--format --help" -- "$cur" ) )
;;
esac
}
_docker_node() {
local subcommands="
accept
@ -1815,6 +1815,16 @@ _docker_node_accept() {
esac
}
_docker_node_demote() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_complete_manager_nodes
esac
}
_docker_node_inspect() {
case "$cur" in
-*)
@ -1843,16 +1853,6 @@ _docker_node_promote() {
esac
}
_docker_node_demote() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_complete_manager_nodes
esac
}
_docker_node_rm() {
case "$cur" in
-*)