diff options
| author | Martin Afanasjew | 2015-10-20 08:10:50 +0200 |
|---|---|---|
| committer | Xu Cheng | 2015-10-20 18:15:18 +0800 |
| commit | 51392352adc73b10c227b71153e66ba620cfb2fd (patch) | |
| tree | c11992dc0eb1a36e18edbdccd59979dc2dae5b32 | |
| parent | 4cfdef65ed52dede275944b174173f665e1e3e3c (diff) | |
| download | brew-51392352adc73b10c227b71153e66ba620cfb2fd.tar.bz2 | |
linkapps/unlinkapps: improve bash/zsh completion
Closes Homebrew/homebrew#45175.
Signed-off-by: Xu Cheng <xucheng@me.com>
| -rw-r--r-- | Library/Contributions/brew_bash_completion.sh | 3 | ||||
| -rw-r--r-- | Library/Contributions/brew_zsh_completion.zsh | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 0c7326176..5f9eeda6a 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -326,6 +326,7 @@ _brew_linkapps () return ;; esac + __brew_complete_installed } _brew_list () @@ -621,7 +622,7 @@ _brew () install|instal|reinstall) _brew_install ;; irb) _brew_irb ;; link|ln) _brew_link ;; - linkapps) _brew_linkapps ;; + linkapps|unlinkapps) _brew_linkapps ;; list|ls) _brew_list ;; log) _brew_log ;; man) _brew_man ;; diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh index 27faa339a..085ffc821 100644 --- a/Library/Contributions/brew_zsh_completion.zsh +++ b/Library/Contributions/brew_zsh_completion.zsh @@ -51,6 +51,7 @@ _1st_arguments=( 'reinstall:install a formula anew; re-using its current options' 'leaves:show installed formulae that are not dependencies of another installed formula' 'link:link a formula' + 'linkapps:symlink .app bundles provided by formulae into /Applications' 'list:list files in a formula or not-installed formulae' 'log:git commit log for a formula' 'missing:check all installed formuale for missing dependencies.' @@ -69,6 +70,7 @@ _1st_arguments=( 'test-bot:test a formula and build a bottle' 'uninstall:uninstall a formula' 'unlink:unlink a formula' + 'unlinkapps:remove symlinked .app bundles provided by formulae from /Applications' 'unpin:unpin specified formulae' 'untap:remove a tapped repository' 'update:fetch latest version of Homebrew and all formulae' @@ -99,6 +101,15 @@ case "$words[1]" in install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|desc|edit|options|switch) _brew_all_formulae _wanted formulae expl 'all formulae' compadd -a formulae ;; + linkapps|unlinkapps) + _arguments \ + '(--local)--local[operate on ~/Applications instead of /Applications]' \ + '1: :->forms' && return 0 + + if [[ "$state" == forms ]]; then + _brew_installed_formulae + _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae + fi ;; list|ls) _arguments \ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ |
