mirror of https://github.com/docker/docs.git
Merge pull request #15525 from albers/completion-option-updates
Updates to bash completion for docker run and docker daemon.
This commit is contained in:
commit
313b37129a
|
@ -139,7 +139,7 @@ __docker_value_of_option() {
|
||||||
local counter=$((command_pos + 1))
|
local counter=$((command_pos + 1))
|
||||||
while [ $counter -lt $cword ]; do
|
while [ $counter -lt $cword ]; do
|
||||||
case ${words[$counter]} in
|
case ${words[$counter]} in
|
||||||
$option_glob )
|
@($option_glob) )
|
||||||
echo ${words[$counter + 1]}
|
echo ${words[$counter + 1]}
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
@ -229,11 +229,12 @@ __docker_log_driver_options() {
|
||||||
# see docs/reference/logging/index.md
|
# see docs/reference/logging/index.md
|
||||||
local fluentd_options="fluentd-address fluentd-tag"
|
local fluentd_options="fluentd-address fluentd-tag"
|
||||||
local gelf_options="gelf-address gelf-tag"
|
local gelf_options="gelf-address gelf-tag"
|
||||||
|
local json_file_options="max-file max-size"
|
||||||
local syslog_options="syslog-address syslog-facility syslog-tag"
|
local syslog_options="syslog-address syslog-facility syslog-tag"
|
||||||
|
|
||||||
case $(__docker_value_of_option --log-driver) in
|
case $(__docker_value_of_option --log-driver) in
|
||||||
'')
|
'')
|
||||||
COMPREPLY=( $( compgen -W "$fluentd_options $gelf_options $syslog_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$fluentd_options $gelf_options $json_file_options $syslog_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
fluentd)
|
fluentd)
|
||||||
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
||||||
|
@ -241,6 +242,9 @@ __docker_log_driver_options() {
|
||||||
gelf)
|
gelf)
|
||||||
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
|
json-file)
|
||||||
|
COMPREPLY=( $( compgen -W "$json_file_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
syslog)
|
syslog)
|
||||||
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
|
@ -515,6 +519,38 @@ _docker_daemon() {
|
||||||
COMPREPLY=( $( compgen -W "aufs btrfs devicemapper overlay vfs zfs" -- "$(echo $cur | tr '[:upper:]' '[:lower:]')" ) )
|
COMPREPLY=( $( compgen -W "aufs btrfs devicemapper overlay vfs zfs" -- "$(echo $cur | tr '[:upper:]' '[:lower:]')" ) )
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
--storage-opt)
|
||||||
|
local devicemapper_options="
|
||||||
|
dm.basesize
|
||||||
|
dm.blkdiscard
|
||||||
|
dm.blocksize
|
||||||
|
dm.fs
|
||||||
|
dm.loopdatasize
|
||||||
|
dm.loopmetadatasize
|
||||||
|
dm.mkfsarg
|
||||||
|
dm.mountopt
|
||||||
|
dm.override_udev_sync_check
|
||||||
|
dm.thinpooldev
|
||||||
|
"
|
||||||
|
local zfs_options="zfs.fsname"
|
||||||
|
|
||||||
|
case $(__docker_value_of_option '--storage-driver|-s') in
|
||||||
|
'')
|
||||||
|
COMPREPLY=( $( compgen -W "$devicemapper_options $zfs_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
devicemapper)
|
||||||
|
COMPREPLY=( $( compgen -W "$devicemapper_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
zfs)
|
||||||
|
COMPREPLY=( $( compgen -W "$zfs_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
compopt -o nospace
|
||||||
|
return
|
||||||
|
;;
|
||||||
--log-level|-l)
|
--log-level|-l)
|
||||||
__docker_log_levels
|
__docker_log_levels
|
||||||
return
|
return
|
||||||
|
@ -528,6 +564,25 @@ _docker_daemon() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case "${words[$cword-2]}$prev=" in
|
||||||
|
*dm.blkdiscard=*)
|
||||||
|
COMPREPLY=( $( compgen -W "false true" -- "${cur#=}" ) )
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*dm.fs=*)
|
||||||
|
COMPREPLY=( $( compgen -W "ext4 xfs" -- "${cur#=}" ) )
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*dm.override_udev_sync_check=*)
|
||||||
|
COMPREPLY=( $( compgen -W "false true" -- "${cur#=}" ) )
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*dm.thinpooldev=*)
|
||||||
|
_filedir
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
-*)
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
||||||
|
@ -998,15 +1053,16 @@ _docker_rmi() {
|
||||||
_docker_run() {
|
_docker_run() {
|
||||||
local options_with_args="
|
local options_with_args="
|
||||||
--add-host
|
--add-host
|
||||||
--blkio-weight
|
|
||||||
--attach -a
|
--attach -a
|
||||||
|
--blkio-weight
|
||||||
--cap-add
|
--cap-add
|
||||||
--cap-drop
|
--cap-drop
|
||||||
--cgroup-parent
|
--cgroup-parent
|
||||||
--cidfile
|
--cidfile
|
||||||
--cpuset
|
|
||||||
--cpu-period
|
--cpu-period
|
||||||
--cpu-quota
|
--cpu-quota
|
||||||
|
--cpuset-cpus
|
||||||
|
--cpuset-mems
|
||||||
--cpu-shares -c
|
--cpu-shares -c
|
||||||
--device
|
--device
|
||||||
--dns
|
--dns
|
||||||
|
@ -1018,8 +1074,8 @@ _docker_run() {
|
||||||
--group-add
|
--group-add
|
||||||
--hostname -h
|
--hostname -h
|
||||||
--ipc
|
--ipc
|
||||||
--label -l
|
|
||||||
--label-file
|
--label-file
|
||||||
|
--label -l
|
||||||
--link
|
--link
|
||||||
--log-driver
|
--log-driver
|
||||||
--log-opt
|
--log-opt
|
||||||
|
@ -1027,14 +1083,15 @@ _docker_run() {
|
||||||
--mac-address
|
--mac-address
|
||||||
--memory -m
|
--memory -m
|
||||||
--memory-swap
|
--memory-swap
|
||||||
|
--memory-swappiness
|
||||||
--name
|
--name
|
||||||
--net
|
--net
|
||||||
--pid
|
--pid
|
||||||
--publish -p
|
--publish -p
|
||||||
--restart
|
--restart
|
||||||
--security-opt
|
--security-opt
|
||||||
--user -u
|
|
||||||
--ulimit
|
--ulimit
|
||||||
|
--user -u
|
||||||
--uts
|
--uts
|
||||||
--volumes-from
|
--volumes-from
|
||||||
--volume -v
|
--volume -v
|
||||||
|
@ -1042,8 +1099,10 @@ _docker_run() {
|
||||||
"
|
"
|
||||||
|
|
||||||
local all_options="$options_with_args
|
local all_options="$options_with_args
|
||||||
|
--disable-content-trust=false
|
||||||
--help
|
--help
|
||||||
--interactive -i
|
--interactive -i
|
||||||
|
--oom-kill-disable
|
||||||
--privileged
|
--privileged
|
||||||
--publish-all -P
|
--publish-all -P
|
||||||
--read-only
|
--read-only
|
||||||
|
@ -1053,7 +1112,7 @@ _docker_run() {
|
||||||
[ "$command" = "run" ] && all_options="$all_options
|
[ "$command" = "run" ] && all_options="$all_options
|
||||||
--detach -d
|
--detach -d
|
||||||
--rm
|
--rm
|
||||||
--sig-proxy
|
--sig-proxy=false
|
||||||
"
|
"
|
||||||
|
|
||||||
local options_with_args_glob=$(__docker_to_extglob "$options_with_args")
|
local options_with_args_glob=$(__docker_to_extglob "$options_with_args")
|
||||||
|
|
Loading…
Reference in New Issue