mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #19409 from albers/completion-network-links
bash completion for container linking and aliasing
This commit is contained in:
commit
8a4b4f5950
1 changed files with 34 additions and 2 deletions
|
@ -1153,12 +1153,41 @@ _docker_logs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_network_connect() {
|
_docker_network_connect() {
|
||||||
|
local options_with_args="
|
||||||
|
--alias
|
||||||
|
--ip
|
||||||
|
--ip6
|
||||||
|
--link
|
||||||
|
"
|
||||||
|
|
||||||
|
local boolean_options="
|
||||||
|
--help
|
||||||
|
"
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--link)
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
-*)
|
*:*)
|
||||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
local counter=$(__docker_pos_first_nonflag)
|
__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 "$boolean_options $options_with_args" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) )
|
||||||
if [ $cword -eq $counter ]; then
|
if [ $cword -eq $counter ]; then
|
||||||
__docker_complete_networks
|
__docker_complete_networks
|
||||||
elif [ $cword -eq $(($counter + 1)) ]; then
|
elif [ $cword -eq $(($counter + 1)) ]; then
|
||||||
|
@ -1488,6 +1517,8 @@ _docker_run() {
|
||||||
--expose
|
--expose
|
||||||
--group-add
|
--group-add
|
||||||
--hostname -h
|
--hostname -h
|
||||||
|
--ip
|
||||||
|
--ip6
|
||||||
--ipc
|
--ipc
|
||||||
--isolation
|
--isolation
|
||||||
--kernel-memory
|
--kernel-memory
|
||||||
|
@ -1503,6 +1534,7 @@ _docker_run() {
|
||||||
--memory-reservation
|
--memory-reservation
|
||||||
--name
|
--name
|
||||||
--net
|
--net
|
||||||
|
--net-alias
|
||||||
--oom-score-adj
|
--oom-score-adj
|
||||||
--pid
|
--pid
|
||||||
--publish -p
|
--publish -p
|
||||||
|
|
Loading…
Add table
Reference in a new issue