diff options
| author | Misty De Meo | 2012-11-05 09:36:59 -0600 |
|---|---|---|
| committer | Misty De Meo | 2012-11-13 15:46:14 -0600 |
| commit | dbc472957ff7288ad61161f625813900bfcfb94a (patch) | |
| tree | 84cf775ad65782ba5c0079a2bd0f4d681c6ae0c4 /Library | |
| parent | 2446e5ee8aa8987d38b4b7df4e7a44d8ab8c810a (diff) | |
| download | brew-dbc472957ff7288ad61161f625813900bfcfb94a.tar.bz2 | |
fish completion: complete formula options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/brew_fish_completion.fish | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Contributions/brew_fish_completion.fish b/Library/Contributions/brew_fish_completion.fish index 1a9cbf9f4..08bfb3c41 100644 --- a/Library/Contributions/brew_fish_completion.fish +++ b/Library/Contributions/brew_fish_completion.fish @@ -86,6 +86,20 @@ function __fish_complete_brew_no_command return 0 end +function __fish_brew_formula_arguments + set formulae (ls (brew --repository)/Library/Formula 2>/dev/null | sed 's/\.rb//g') + for formula in (ls (brew --repository)/Library/Aliases 2>/dev/null | sed 's/\.rb//g') + set formulae $formula $formulae + end + + for cmd in (commandline -opc) + if contains -- $cmd $formulae + brew options $cmd --compact | tr ' ' '\n' + end + end +end + +complete -c brew --arguments '(__fish_brew_formula_arguments)' complete -c brew -x -a "$commands" -n '__fish_complete_brew_no_command' complete -c brew -x -a '(__fish_complete_brew_argument)' -n '__fish_complete_brew_has_command' |
