Fix download url for Compose's command completion (#4420)

* Fix download urls for compose command completion

Signed-off-by: Harald Albers <github@albersweb.de>

* Use sudo when installing bash completion

Writing to the system-wide completion plugin directory `/etc/bash_completion.d/`
requires root permissions.

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-08-29 20:08:43 +02:00 committed by Victoria Bialas
parent 9aa87cd0a0
commit 6861d77db3
1 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,8 @@ keywords: fig, composition, compose, docker, orchestration, cli, reference
title: Command-line completion
---
{% assign composeversion = '1.15.0' %}
Compose comes with [command completion](http://en.wikipedia.org/wiki/Command-line_completion)
for the bash and zsh shell.
@ -22,7 +24,7 @@ Place the completion script in `/etc/bash_completion.d/`
(or `/usr/local/etc/bash_completion.d/` on a Mac):
```shell
curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
sudo curl -L https://raw.githubusercontent.com/docker/compose/{{composeversion}}/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
```
On a Mac, add the following to your `~/.bash_profile`:
@ -59,7 +61,7 @@ Place the completion script in your `/path/to/zsh/completion`, using e.g. `~/.zs
```shell
$ mkdir -p ~/.zsh/completion
$ curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
$ curl -L https://raw.githubusercontent.com/docker/compose/{{composeversion}}/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
```
Include the directory in your `$fpath`, e.g. by adding in `~/.zshrc`: