mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #20562 from albers/completion-update--restart
Add bash completion for `docker update --restart`
This commit is contained in:
commit
5d33ff7e9d
1 changed files with 20 additions and 10 deletions
|
@ -516,6 +516,22 @@ __docker_complete_log_levels() {
|
|||
COMPREPLY=( $( compgen -W "debug info warn error fatal" -- "$cur" ) )
|
||||
}
|
||||
|
||||
__docker_complete_restart() {
|
||||
case "$prev" in
|
||||
--restart)
|
||||
case "$cur" in
|
||||
on-failure:*)
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "always no on-failure on-failure: unless-stopped" -- "$cur") )
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
# a selection of the available signals that is most likely of interest in the
|
||||
# context of docker containers.
|
||||
__docker_complete_signals() {
|
||||
|
@ -1658,6 +1674,7 @@ _docker_run() {
|
|||
|
||||
|
||||
__docker_complete_log_driver_options && return
|
||||
__docker_complete_restart && return
|
||||
|
||||
case "$prev" in
|
||||
--add-host)
|
||||
|
@ -1755,16 +1772,6 @@ _docker_run() {
|
|||
esac
|
||||
return
|
||||
;;
|
||||
--restart)
|
||||
case "$cur" in
|
||||
on-failure:*)
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "always no on-failure on-failure: unless-stopped" -- "$cur") )
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
--security-opt)
|
||||
case "$cur" in
|
||||
label:*:*)
|
||||
|
@ -1939,6 +1946,7 @@ _docker_update() {
|
|||
--memory -m
|
||||
--memory-reservation
|
||||
--memory-swap
|
||||
--restart
|
||||
"
|
||||
|
||||
local boolean_options="
|
||||
|
@ -1947,6 +1955,8 @@ _docker_update() {
|
|||
|
||||
local all_options="$options_with_args $boolean_options"
|
||||
|
||||
__docker_complete_restart && return
|
||||
|
||||
case "$prev" in
|
||||
$(__docker_to_extglob "$options_with_args") )
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue