saltstack/salt — pull request #15310 by rominf (2014-08-27 15:27:24+00:00)
Title: Add fish shell completions for salt programs

Add completions for salt and other programs in [fish shell](http://fishshell.com/).

Features:
1. Long and short options completions (with help).
2. Minion id completion.
3. Function completion.
4. Function arguments completion.
5. Function arguments value completion (for some functions). Includes:
1. File completion for (minion and master files).
2. Grain completion.
3. State completion.
4. Function and module completion (documentation functions).

See salt.fish comments for more details.

![salt_fish_autocomplete](https://cloud.githubusercontent.com/assets/3449635/4061969/56c41934-2dfc-11e4-9a66-50ed784cdf60.gif)

I didn't provide auto-completion for all arguments due one reason: it's a routine work that should be automated. It can't be done automatically, because arguments I needed to read the information, provided by `sys.doc` and `sys.argspec`, and combine them. Most of all, sometimes they are contradictory. For example, in stable version (https://github.com/saltstack/salt/tree/v2014.1.10) help for `state.highstate` contains:
```
salt '*' state.highstate exclude=sls_to_exclude
```
but `sys.argspec` says:
```
state.highstate:
----------
args:
- test
- queue
```

Bash and fish completion could be done mostly automatically if I could extract types of arguments. I suggested solution of this problem in #14164. It will help extract all the information from the arguments from one point: their specification. It will help validate, create argspec (with real types like `MinionFile`, `Function`, `Grain` and so on), argument documentation (like in states documentation), command string for executing it from `cmd` (if the function is tightly connected to the console program, like `zypper.install`), make bash and fish auto-completion for arguments. So, this would reduce duplication and make salt more stable due verification.

PS: cast @aboe76 to package this.