mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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
1 changed files with 66 additions and 7 deletions
|
@ -139,7 +139,7 @@ __docker_value_of_option() {
|
|||
local counter=$((command_pos + 1))
|
||||
while [ $counter -lt $cword ]; do
|
||||
case ${words[$counter]} in
|
||||
$option_glob )
|
||||
@($option_glob) )
|
||||
echo ${words[$counter + 1]}
|
||||
break
|
||||
;;
|
||||
|
@ -229,11 +229,12 @@ __docker_log_driver_options() {
|
|||
# see docs/reference/logging/index.md
|
||||
local fluentd_options="fluentd-address fluentd-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"
|
||||
|
||||
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)
|
||||
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
||||
|
@ -241,6 +242,9 @@ __docker_log_driver_options() {
|
|||
gelf)
|
||||
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
||||
;;
|
||||
json-file)
|
||||
COMPREPLY=( $( compgen -W "$json_file_options" -S = -- "$cur" ) )
|
||||
;;
|
||||
syslog)
|
||||
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:]')" ) )
|
||||
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)
|
||||
__docker_log_levels
|
||||
return
|
||||
|
@ -528,6 +564,25 @@ _docker_daemon() {
|
|||
;;
|
||||
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
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
||||
|
@ -998,15 +1053,16 @@ _docker_rmi() {
|
|||
_docker_run() {
|
||||
local options_with_args="
|
||||
--add-host
|
||||
--blkio-weight
|
||||
--attach -a
|
||||
--blkio-weight
|
||||
--cap-add
|
||||
--cap-drop
|
||||
--cgroup-parent
|
||||
--cidfile
|
||||
--cpuset
|
||||
--cpu-period
|
||||
--cpu-quota
|
||||
--cpuset-cpus
|
||||
--cpuset-mems
|
||||
--cpu-shares -c
|
||||
--device
|
||||
--dns
|
||||
|
@ -1018,8 +1074,8 @@ _docker_run() {
|
|||
--group-add
|
||||
--hostname -h
|
||||
--ipc
|
||||
--label -l
|
||||
--label-file
|
||||
--label -l
|
||||
--link
|
||||
--log-driver
|
||||
--log-opt
|
||||
|
@ -1027,14 +1083,15 @@ _docker_run() {
|
|||
--mac-address
|
||||
--memory -m
|
||||
--memory-swap
|
||||
--memory-swappiness
|
||||
--name
|
||||
--net
|
||||
--pid
|
||||
--publish -p
|
||||
--restart
|
||||
--security-opt
|
||||
--user -u
|
||||
--ulimit
|
||||
--user -u
|
||||
--uts
|
||||
--volumes-from
|
||||
--volume -v
|
||||
|
@ -1042,8 +1099,10 @@ _docker_run() {
|
|||
"
|
||||
|
||||
local all_options="$options_with_args
|
||||
--disable-content-trust=false
|
||||
--help
|
||||
--interactive -i
|
||||
--oom-kill-disable
|
||||
--privileged
|
||||
--publish-all -P
|
||||
--read-only
|
||||
|
@ -1053,7 +1112,7 @@ _docker_run() {
|
|||
[ "$command" = "run" ] && all_options="$all_options
|
||||
--detach -d
|
||||
--rm
|
||||
--sig-proxy
|
||||
--sig-proxy=false
|
||||
"
|
||||
|
||||
local options_with_args_glob=$(__docker_to_extglob "$options_with_args")
|
||||
|
|
Loading…
Add table
Reference in a new issue