mirror of https://github.com/docker/docs.git
fix formatting issues in completion.md file
This commit is contained in:
parent
87be333941
commit
ed87d31a00
|
@ -17,11 +17,12 @@ Make sure bash completion is installed.
|
||||||
|
|
||||||
1. On a current Linux OS (in a non-minimal installation), bash completion should be
|
1. On a current Linux OS (in a non-minimal installation), bash completion should be
|
||||||
available.
|
available.
|
||||||
|
|
||||||
2. Place the completion script in `/etc/bash_completion.d/`.
|
2. Place the completion script in `/etc/bash_completion.d/`.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
|
sudo curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mac
|
### Mac
|
||||||
|
|
||||||
|
@ -32,17 +33,17 @@ sudo curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_ver
|
||||||
|
|
||||||
For example, when running this command on Mac 10.13.2, place the completion script in `/usr/local/etc/bash_completion.d/`.
|
For example, when running this command on Mac 10.13.2, place the completion script in `/usr/local/etc/bash_completion.d/`.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/bash/docker-compose -o /usr/local/etc/bash_completion.d/docker-compose
|
sudo curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/bash/docker-compose -o /usr/local/etc/bash_completion.d/docker-compose
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add the following to your `~/.bash_profile`:
|
3. Add the following to your `~/.bash_profile`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
if [ -f $(brew --prefix)/etc/bash_completion ]; then
|
if [ -f $(brew --prefix)/etc/bash_completion ]; then
|
||||||
. $(brew --prefix)/etc/bash_completion
|
. $(brew --prefix)/etc/bash_completion
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
4. You can source your `~/.bash_profile` or launch a new terminal to utilize
|
4. You can source your `~/.bash_profile` or launch a new terminal to utilize
|
||||||
completion.
|
completion.
|
||||||
|
@ -50,13 +51,14 @@ completion.
|
||||||
##### Install via MacPorts
|
##### Install via MacPorts
|
||||||
|
|
||||||
1. Run `sudo port install bash-completion` to install bash completion.
|
1. Run `sudo port install bash-completion` to install bash completion.
|
||||||
|
|
||||||
2. Add the following lines to `~/.bash_profile`:
|
2. Add the following lines to `~/.bash_profile`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
|
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
|
||||||
. /opt/local/etc/profile.d/bash_completion.sh
|
. /opt/local/etc/profile.d/bash_completion.sh
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
3. You can source your `~/.bash_profile` or launch a new terminal to utilize
|
3. You can source your `~/.bash_profile` or launch a new terminal to utilize
|
||||||
completion.
|
completion.
|
||||||
|
@ -72,34 +74,34 @@ Add `docker` and `docker-compose` to the plugins list in `~/.zshrc` to run autoc
|
||||||
```shell
|
```shell
|
||||||
plugins=(... docker docker-compose
|
plugins=(... docker docker-compose
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Without oh-my-zsh shell
|
#### Without oh-my-zsh shell
|
||||||
|
|
||||||
1. Place the completion script in your `/path/to/zsh/completion` (typically `~/.zsh/completion/`):
|
1. Place the completion script in your `/path/to/zsh/completion` (typically `~/.zsh/completion/`):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ mkdir -p ~/.zsh/completion
|
$ mkdir -p ~/.zsh/completion
|
||||||
$ curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
|
$ curl -L https://raw.githubusercontent.com/docker/compose/{{site.compose_version}}/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Include the directory in your `$fpath` by adding in `~/.zshrc`:
|
2. Include the directory in your `$fpath` by adding in `~/.zshrc`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
fpath=(~/.zsh/completion $fpath)
|
fpath=(~/.zsh/completion $fpath)
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Make sure `compinit` is loaded or do it by adding in `~/.zshrc`:
|
3. Make sure `compinit` is loaded or do it by adding in `~/.zshrc`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
autoload -Uz compinit && compinit -i
|
autoload -Uz compinit && compinit -i
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Then reload your shell:
|
4. Then reload your shell:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
exec $SHELL -l
|
exec $SHELL -l
|
||||||
```
|
```
|
||||||
|
|
||||||
## Available completions
|
## Available completions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue