Merge pull request #2701 from dgageot/completions

Fix completion installation guide
This commit is contained in:
Nathan LeClaire 2015-12-29 11:32:51 -08:00
commit 14ea20ffdb
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@
_docker_machine_active() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--swarm --help" -- "${cur}"))
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=()
fi
@ -119,7 +119,7 @@ _docker_machine_restart() {
_docker_machine_rm() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --force" -- "${cur}"))
COMPREPLY=($(compgen -W "--help --force -y" -- "${cur}"))
else
# For rm, it's best to be explicit
COMPREPLY=()
@ -215,7 +215,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 help)
local commands=(active config create env inspect ip kill ls 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)

View File

@ -25,7 +25,7 @@ Place the completion scripts in `/etc/bash_completion.d/` (`` `brew --prefix`/et
files=(docker-machine docker-machine-wrapper docker-machine-prompt)
for f in "${files[@]}"; do
curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | awk 'NR==1{print $(NF-1)}')/contrib/completion/bash/$f.bash > `brew --prefix`/etc/bash_completion.d/$f
curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | tr -ds ',' ' ' | awk 'NR==1{print $(3)}')/contrib/completion/bash/$f.bash > `brew --prefix`/etc/bash_completion.d/$f
done
Completion will be available upon next login.
@ -40,7 +40,7 @@ Place the completion scripts in your `/path/to/zsh/completion`, using e.g. `~/.z
mkdir -p ~/.zsh/completion
files=(docker-machine docker-machine-wrapper docker-machine-prompt)
for f in "${files[@]}"; do
curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | awk 'NR==1{print $(NF-1)}')/contrib/completion/zsh/$f > ~/.zsh/completion/_$f
curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | tr -ds ',' ' ' | awk 'NR==1{print $(3)}')/contrib/completion/zsh/$f > ~/.zsh/completion/_$f
done
Include the directory in your `$fpath`, e.g. by adding in `~/.zshrc`