From ca458a8ed1de8250d22cf6c48f90ab34cb47bea9 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Fri, 10 Jul 2015 23:22:46 +0800 Subject: [PATCH] shell completion: support external commands Closes Homebrew/homebrew#41519. Signed-off-by: Xu Cheng --- Library/Contributions/brew_bash_completion.sh | 59 +------------------ Library/Contributions/brew_zsh_completion.zsh | 4 +- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 75ecf2b136..54413357b7 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -580,62 +580,7 @@ _brew () done if [[ $i -eq $COMP_CWORD ]]; then - __brewcomp " - --cache --cellar - --env --prefix --repository - aspell-dictionaries - audit - bottle - cat - cleanup - commands - config --config - create - deps - diy configure - doctor - edit - fetch - gist-logs - help - home - info abv - install - irb - leaves - linkapps - link ln - list ls - log - man - missing - options - outdated - prune - pin - postinstall - pull - readall - search - reinstall - sh - style - switch - tap - tap-readme - test - test-bot - tests - uninstall remove rm - unlink - unlinkapps - unpack - unpin - untap - update - upgrade - uses - " + __brewcomp "$(brew commands --quiet --include-aliases)" return fi @@ -677,7 +622,7 @@ _brew () uninstall|remove|rm) _brew_uninstall ;; unpack) _brew_unpack ;; unpin) __brew_complete_formulae ;; - untap) __brew_complete_tapped ;; + untap|tap-info) __brew_complete_tapped ;; update) _brew_update ;; upgrade) _brew_upgrade ;; uses) _brew_uses ;; diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh index 0a30cd23fc..186ebb4427 100644 --- a/Library/Contributions/brew_zsh_completion.zsh +++ b/Library/Contributions/brew_zsh_completion.zsh @@ -25,7 +25,6 @@ _brew_outdated_formulae() { local -a _1st_arguments _1st_arguments=( 'audit:check formulae for Homebrew coding style' - 'bundle:look for a Brewfile and run each line as a brew command' 'cat:display formula file for a formula' 'cleanup:uninstall unused and old versions of packages' 'commands:show a list of commands' @@ -55,6 +54,7 @@ _1st_arguments=( 'update:freshen up links' 'upgrade:upgrade outdated formulae' 'uses:show formulae which depend on a formula' + `brew commands --quiet --include-aliases` ) local expl @@ -97,7 +97,7 @@ case "$words[1]" in _arguments \ '(--macports)--macports[search the macports repository]' \ '(--fink)--fink[search the fink repository]' ;; - untap) + untap|tap-info) _brew_installed_taps _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;; upgrade)