Adding bash completion and helper scripts

This patch adds some bash helper scripts.

 * docker-machine.bash - command completion for docker-machine
 * docker-machine-prompt.bash - function for putting the active machine
   name in PS1
 * docker-machine-wrapper.bash - function wrapper adding an `use`
   command that runs `eval $(docker-machine env whatever)` in the
   current shell.

Signed-off-by: David M. Lee <dlee@respoke.io>
This commit is contained in:
David M. Lee
2015-10-15 19:25:20 -04:00
parent 07bcb9a7aa
commit 7180ddca87
5 changed files with 367 additions and 0 deletions

View File

@@ -57,6 +57,25 @@ to your PATH.
$ docker-machine -v
machine version 0.5.0 (3e06852)
## Installing bash completion scripts
The Machine repository supplies several `bash` scripts that add features such
as:
* command completion
* a function that displays the active machine in your shell prompt
* a function wrapper that adds a `docker-machine use` subcommand to switch the
active machine
To install the scripts, copy or link them into your `/etc/bash_completion.d` or
`/usr/local/etc/bash_completion.d` file. To enable the `docker-machine` shell
prompt, add `$(__docker-machine-ps1)` to your `PS1` setting in `~/.bashrc`.
PS1='[\u@\h \W$(__docker-machine-ps1)]\$ '
You can find additional documentation in the comments at the
[top of each script](https://github.com/docker/machine/tree/master/contrib/completion/bash).
## Where to go next
* [Docker Machine overview](/)