mirror of https://github.com/docker/docs.git
Merge pull request #2701 from dgageot/completions
Fix completion installation guide
This commit is contained in:
commit
14ea20ffdb
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
_docker_machine_active() {
|
_docker_machine_active() {
|
||||||
if [[ "${cur}" == -* ]]; then
|
if [[ "${cur}" == -* ]]; then
|
||||||
COMPREPLY=($(compgen -W "--swarm --help" -- "${cur}"))
|
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
|
||||||
else
|
else
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
fi
|
fi
|
||||||
|
@ -119,7 +119,7 @@ _docker_machine_restart() {
|
||||||
|
|
||||||
_docker_machine_rm() {
|
_docker_machine_rm() {
|
||||||
if [[ "${cur}" == -* ]]; then
|
if [[ "${cur}" == -* ]]; then
|
||||||
COMPREPLY=($(compgen -W "--help --force" -- "${cur}"))
|
COMPREPLY=($(compgen -W "--help --force -y" -- "${cur}"))
|
||||||
else
|
else
|
||||||
# For rm, it's best to be explicit
|
# For rm, it's best to be explicit
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
|
@ -215,7 +215,7 @@ _docker_machine_docker_machine() {
|
||||||
|
|
||||||
_docker_machine() {
|
_docker_machine() {
|
||||||
COMPREPLY=()
|
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 flags=(--debug --native-ssh --github-api-token --bugsnag-api-token --help --version)
|
||||||
local wants_dir=(--storage-path)
|
local wants_dir=(--storage-path)
|
||||||
|
|
|
@ -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)
|
files=(docker-machine docker-machine-wrapper docker-machine-prompt)
|
||||||
for f in "${files[@]}"; do
|
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
|
done
|
||||||
|
|
||||||
Completion will be available upon next login.
|
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
|
mkdir -p ~/.zsh/completion
|
||||||
files=(docker-machine docker-machine-wrapper docker-machine-prompt)
|
files=(docker-machine docker-machine-wrapper docker-machine-prompt)
|
||||||
for f in "${files[@]}"; do
|
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
|
done
|
||||||
|
|
||||||
Include the directory in your `$fpath`, e.g. by adding in `~/.zshrc`
|
Include the directory in your `$fpath`, e.g. by adding in `~/.zshrc`
|
||||||
|
|
Loading…
Reference in New Issue