From 1729729eb3099521bd6b07680ed5646e7736443f Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 10 May 2017 11:58:36 +0200 Subject: [PATCH 1/2] Add bash completion for `docker-machine provision` Signed-off-by: Harald Albers --- contrib/completion/bash/docker-machine.bash | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker-machine.bash b/contrib/completion/bash/docker-machine.bash index 58ecac91..d99abbd8 100644 --- a/contrib/completion/bash/docker-machine.bash +++ b/contrib/completion/bash/docker-machine.bash @@ -153,6 +153,14 @@ _docker_machine_ls() { fi } +_docker_machine_provision() { + if [[ "${cur}" == -* ]]; then + COMPREPLY=($(compgen -W "--help" -- "${cur}")) + else + COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -- "${cur}")) + fi +} + _docker_machine_regenerate_certs() { if [[ "${cur}" == -* ]]; then COMPREPLY=($(compgen -W "--force -f --help" -- "${cur}")) @@ -266,7 +274,7 @@ _docker_machine_docker_machine() { _docker_machine() { COMPREPLY=() - local commands=(active config create env inspect ip kill ls regenerate-certs restart rm ssh scp start status stop upgrade url version help) + local commands=(active config create env inspect ip kill ls provision regenerate-certs restart rm ssh scp start status stop upgrade url version help) local flags=(--debug --native-ssh --github-api-token --bugsnag-api-token --help --version) local wants_dir=(--storage-path) From bd3211dbdf01dcc848f0f561b350237ae3f9a128 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 11 May 2017 08:51:37 +0200 Subject: [PATCH 2/2] bash completion for `regenerate-certs` completes running machines only Signed-off-by: Harald Albers --- contrib/completion/bash/docker-machine.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker-machine.bash b/contrib/completion/bash/docker-machine.bash index d99abbd8..f5c564b3 100644 --- a/contrib/completion/bash/docker-machine.bash +++ b/contrib/completion/bash/docker-machine.bash @@ -165,7 +165,7 @@ _docker_machine_regenerate_certs() { if [[ "${cur}" == -* ]]; then COMPREPLY=($(compgen -W "--force -f --help" -- "${cur}")) else - COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}")) + COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -- "${cur}")) fi }