From 4e97e95cd8e8882494fd232b7ba047958af58903 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 18 Jan 2016 08:55:23 -0800 Subject: [PATCH] Support new events in bash completion Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index ddd91f176f..2fb67d2b2d 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -862,7 +862,7 @@ _docker_diff() { _docker_events() { case "$prev" in --filter|-f) - COMPREPLY=( $( compgen -S = -W "container event image" -- "$cur" ) ) + COMPREPLY=( $( compgen -S = -W "container event image label network type volume" -- "$cur" ) ) __docker_nospace return ;; @@ -881,16 +881,19 @@ _docker_events() { COMPREPLY=( $( compgen -W " attach commit + connect copy create delete destroy die + disconnect exec_create exec_start export import kill + mount oom pause pull @@ -902,8 +905,10 @@ _docker_events() { stop tag top + unmount unpause untag + update " -- "${cur#=}" ) ) return ;; @@ -912,6 +917,21 @@ _docker_events() { __docker_complete_images return ;; + *network=*) + ## BUG: this also triggers after -f type=network + cur="${cur#=}" + __docker_complete_networks + return + ;; + *type=*) + COMPREPLY=( $( compgen -W "container image network volume" -- "${cur#=}" ) ) + return + ;; + *volume=*) + cur="${cur#=}" + __docker_complete_volumes + return + ;; esac case "$cur" in