зеркало из https://github.com/microsoft/docker.git
Merge pull request #19811 from albers/completion-user
Improve bash completion for users and groups
This commit is contained in:
Коммит
17be787dca
|
@ -535,6 +535,15 @@ __docker_complete_signals() {
|
|||
COMPREPLY=( $( compgen -W "${signals[*]} ${signals[*]#SIG}" -- "$( echo $cur | tr '[:lower:]' '[:upper:]')" ) )
|
||||
}
|
||||
|
||||
__docker_complete_user_group() {
|
||||
if [[ $cur == *:* ]] ; then
|
||||
COMPREPLY=( $(compgen -g -- "${cur#*:}") )
|
||||
else
|
||||
COMPREPLY=( $(compgen -u -S : -- "$cur") )
|
||||
__docker_nospace
|
||||
fi
|
||||
}
|
||||
|
||||
# global options that may appear after the docker command
|
||||
_docker_docker() {
|
||||
local boolean_options="
|
||||
|
@ -851,12 +860,7 @@ _docker_daemon() {
|
|||
return
|
||||
;;
|
||||
--userns-remap)
|
||||
if [[ $cur == *:* ]] ; then
|
||||
COMPREPLY=( $(compgen -g -- "${cur#*:}") )
|
||||
else
|
||||
COMPREPLY=( $(compgen -u -S : -- "$cur") )
|
||||
__docker_nospace
|
||||
fi
|
||||
__docker_complete_user_group
|
||||
return
|
||||
;;
|
||||
$(__docker_to_extglob "$options_with_args") )
|
||||
|
@ -995,6 +999,7 @@ _docker_exec() {
|
|||
|
||||
case "$prev" in
|
||||
--user|-u)
|
||||
__docker_complete_user_group
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
@ -1769,6 +1774,10 @@ _docker_run() {
|
|||
esac
|
||||
return
|
||||
;;
|
||||
--user|-u)
|
||||
__docker_complete_user_group
|
||||
return
|
||||
;;
|
||||
--volume-driver)
|
||||
__docker_complete_plugins Volume
|
||||
return
|
||||
|
|
Загрузка…
Ссылка в новой задаче