Skip to content

Commit 2406a39

Browse files
committed
Documentation for bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
1 parent 69db596 commit 2406a39

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

docs/completion.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: default
3+
title: Command Completion
4+
---
5+
6+
Command Completion
7+
==================
8+
9+
Fig comes with [command completion](http://en.wikipedia.org/wiki/Command-line_completion)
10+
for the bash shell.
11+
12+
Installing Command Completion
13+
-----------------------------
14+
15+
Make sure bash completion is installed. If you use a current Linux in a non-minimal installation, bash completion should be available.
16+
On a Mac, install with `brew install bash-completion`
17+
18+
Place the completion script in `/etc/bash_completion.d/` (`/usr/local/etc/bash_completion.d/` on a Mac), using e.g.
19+
20+
curl -L https://raw.githubusercontent.com/docker/fig/master/contrib/completion/bash/fig > /etc/bash_completion.d/fig
21+
22+
Completion will be available upon next login.
23+
24+
Available completions
25+
---------------------
26+
Depending on what you typed on the command line so far, it will complete
27+
28+
- available fig commands
29+
- options that are available for a particular command
30+
- service names that make sense in a given context (e.g. services with running or stopped instances or services based on images vs. services based on Dockerfiles). For `fig scale`, completed service names will automatically have "=" appended.
31+
- arguments for selected options, e.g. `fig kill -s` will complete some signals like SIGHUP and SIGUSR1.
32+
33+
Enjoy working with fig faster and with less typos!

docs/install.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Next, install Fig:
2020

2121
curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
2222

23+
Optionally, install [command completion](completion.html) for the bash shell.
24+
2325
Releases are available for OS X and 64-bit Linux. Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):
2426

2527
$ sudo pip install -U fig

0 commit comments

Comments
 (0)