зеркало из https://github.com/microsoft/docker.git
Add latest docker options to docker.bash
Adds bash completion options for the latest docker release (0.6.1)
This commit is contained in:
Родитель
820a3b962a
Коммит
02d1d238cd
|
@ -115,7 +115,7 @@ _docker_build()
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
-*)
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-t -q" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-no-cache -t -q" -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_filedir
|
_filedir
|
||||||
|
@ -138,9 +138,35 @@ _docker_commit()
|
||||||
COMPREPLY=( $( compgen -W "-author -m -run" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-author -m -run" -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
__docker_containers_all
|
local counter=$cpos
|
||||||
|
while [ $counter -le $cword ]; do
|
||||||
|
case "${words[$counter]}" in
|
||||||
|
-author|-m|-run)
|
||||||
|
(( counter++ ))
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
(( counter++ ))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $counter -eq $cword ]; then
|
||||||
|
__docker_containers_all
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_docker_cp()
|
||||||
|
{
|
||||||
|
if [ $cpos -eq $cword ]; then
|
||||||
|
__docker_containers_all
|
||||||
|
else
|
||||||
|
_filedir
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_diff()
|
_docker_diff()
|
||||||
|
@ -152,7 +178,21 @@ _docker_diff()
|
||||||
|
|
||||||
_docker_events()
|
_docker_events()
|
||||||
{
|
{
|
||||||
|
case "$prev" in
|
||||||
|
-since)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-since" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-since" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_export()
|
_docker_export()
|
||||||
|
@ -231,7 +271,21 @@ _docker_kill()
|
||||||
|
|
||||||
_docker_login()
|
_docker_login()
|
||||||
{
|
{
|
||||||
|
case "$prev" in
|
||||||
|
-e|-p|-u)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-e -p -u" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-e -p -u" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_logs()
|
_docker_logs()
|
||||||
|
@ -250,12 +304,40 @@ _docker_port()
|
||||||
|
|
||||||
_docker_ps()
|
_docker_ps()
|
||||||
{
|
{
|
||||||
|
case "$prev" in
|
||||||
|
-beforeId|-n|-sinceId)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-a -beforeId -l -n -notrunc -q -s -sinceId" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-a -beforeId -l -n -notrunc -q -s -sinceId" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_pull()
|
_docker_pull()
|
||||||
{
|
{
|
||||||
|
case "$prev" in
|
||||||
|
-t)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-t" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-t" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_push()
|
_docker_push()
|
||||||
|
@ -309,7 +391,7 @@ _docker_run()
|
||||||
-volumes-from)
|
-volumes-from)
|
||||||
__docker_containers_all
|
__docker_containers_all
|
||||||
;;
|
;;
|
||||||
-a|-c|-dns|-e|-entrypoint|-h|-m|-p|-u|-v)
|
-a|-c|-dns|-e|-entrypoint|-h|-lxc-conf|-m|-p|-u|-v|-w)
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -318,18 +400,13 @@ _docker_run()
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
-*)
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-a -c -cidfile -d -dns -e -entrypoint -h -i -m -n -p -t -u -v -volumes-from" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-a -c -cidfile -d -dns -e -entrypoint -h -i -lxc-conf -m -n -p -privileged -t -u -v -volumes-from -w" -- "$cur" ) )
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case "$cur" in
|
|
||||||
-*)
|
|
||||||
COMPREPLY=( $( compgen -W "-a -notrunc -q -viz" -- "$cur" ) )
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
local counter=$cpos
|
local counter=$cpos
|
||||||
while [ $counter -le $cword ]; do
|
while [ $counter -le $cword ]; do
|
||||||
case "${words[$counter]}" in
|
case "${words[$counter]}" in
|
||||||
-a|-c|-cidfile|-dns|-e|-entrypoint|-h|-m|-p|-u|-v|-volumes-from)
|
-a|-c|-cidfile|-dns|-e|-entrypoint|-h|-lxc-conf|-m|-p|-u|-v|-volumes-from|-w)
|
||||||
(( counter++ ))
|
(( counter++ ))
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
|
@ -346,8 +423,6 @@ _docker_run()
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_search()
|
_docker_search()
|
||||||
|
@ -409,6 +484,7 @@ _docker()
|
||||||
attach
|
attach
|
||||||
build
|
build
|
||||||
commit
|
commit
|
||||||
|
cp
|
||||||
diff
|
diff
|
||||||
events
|
events
|
||||||
export
|
export
|
||||||
|
|
Загрузка…
Ссылка в новой задаче