mirror of
https://github.com/docker/cli.git
synced 2026-01-18 08:21:31 +03:00
bash completion for container linking and aliasing
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 16c9a72852
Component: cli
This commit is contained in:
committed by
Tibor Vass
parent
bd29bc3d11
commit
3a19e416a5
@@ -1153,12 +1153,41 @@ _docker_logs() {
|
||||
}
|
||||
|
||||
_docker_network_connect() {
|
||||
local options_with_args="
|
||||
--alias
|
||||
--ip
|
||||
--ip6
|
||||
--link
|
||||
"
|
||||
|
||||
local boolean_options="
|
||||
--help
|
||||
"
|
||||
|
||||
case "$prev" in
|
||||
--link)
|
||||
case "$cur" in
|
||||
*:*)
|
||||
;;
|
||||
*)
|
||||
__docker_complete_containers_running
|
||||
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
|
||||
__docker_nospace
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
$(__docker_to_extglob "$options_with_args") )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag)
|
||||
local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) )
|
||||
if [ $cword -eq $counter ]; then
|
||||
__docker_complete_networks
|
||||
elif [ $cword -eq $(($counter + 1)) ]; then
|
||||
@@ -1488,6 +1517,8 @@ _docker_run() {
|
||||
--expose
|
||||
--group-add
|
||||
--hostname -h
|
||||
--ip
|
||||
--ip6
|
||||
--ipc
|
||||
--isolation
|
||||
--kernel-memory
|
||||
@@ -1503,6 +1534,7 @@ _docker_run() {
|
||||
--memory-reservation
|
||||
--name
|
||||
--net
|
||||
--net-alias
|
||||
--oom-score-adj
|
||||
--pid
|
||||
--publish -p
|
||||
|
||||
Reference in New Issue
Block a user