From 5f1c5b28a719d63005ce5e2190348bdfbce629c3 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sun, 29 May 2016 07:09:05 -0700 Subject: [PATCH] bash completion for dockerd Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 4f60da7a49..5dccb7596c 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2308,6 +2308,14 @@ _docker() { (( counter++ )) done + local binary="${words[0]}" + if [[ $binary == dockerd ]] ; then + # for the dockerd binary, we reuse completion of `docker daemon`. + # dockerd does not have subcommands and global options. + command=daemon + command_pos=0 + fi + local completions_func=_docker_${command} declare -F $completions_func >/dev/null && $completions_func @@ -2318,4 +2326,4 @@ _docker() { eval "$__docker_previous_extglob_setting" unset __docker_previous_extglob_setting -complete -F _docker docker +complete -F _docker docker dockerd