Skip to content

Commit

Permalink
updated url and download script (docker#2405)
Browse files Browse the repository at this point in the history
* updated url and download script

* added separate Mac and Linux examples

Signed-off-by: Victoria Bialas <[email protected]>
  • Loading branch information
btro authored and londoncalling committed Mar 28, 2017
1 parent 1fdf927 commit efd7aa3
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions machine/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ for the bash and zsh shell.

### Bash

Make sure bash completion is installed. If you use a current Linux in a non-minimal installation, bash completion should be available.
On a Mac, install with `brew install bash-completion`
Make sure bash completion is installed. If you are using a current version of Linux in a non-minimal installation, bash completion should be available.

Place the completion scripts in `/etc/bash_completion.d/` (`` `brew --prefix`/etc/bash_completion.d/`` on a Mac), using e.g.
On a Mac, install with `brew install bash-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 | tr -ds ',' ' ' | awk 'NR==1{print $(3)}')/contrib/completion/bash/$f.bash > `brew --prefix`/etc/bash_completion.d/$f
done
Place the completion script in `/etc/bash_completion.d/` as follows:

* On a Mac:

```none
curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > `brew --prefix`/etc/bash_completion.d/docker
```
* On a standard Linux installation:
```none
curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > /etc/bash_completion.d/docker
```
Completion will be available upon next login.
Expand All @@ -29,7 +37,7 @@ Completion will be available upon next login.
Place the completion scripts in your `/path/to/zsh/completion`, using e.g. `~/.zsh/completion/`
mkdir -p ~/.zsh/completion
curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | tr -ds ',' ' ' | awk 'NR==1{print $(3)}')/contrib/completion/zsh/_docker-machine > ~/.zsh/completion/_docker-machine
curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/zsh/_docker > ~/.zsh/completion/_docker-machine
Include the directory in your `$fpath`, e.g. by adding in `~/.zshrc`
Expand All @@ -48,4 +56,4 @@ Then reload your shell
## Available completions
**TODO**
<![end-metadata]-->
<![end-metadata]-->

0 comments on commit efd7aa3

Please sign in to comment.