linkapps/unlinkapps: improve bash/zsh completion
Closes Homebrew/homebrew#45175. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
4cfdef65ed
commit
51392352ad
@ -326,6 +326,7 @@ _brew_linkapps ()
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
__brew_complete_installed
|
||||||
}
|
}
|
||||||
|
|
||||||
_brew_list ()
|
_brew_list ()
|
||||||
@ -621,7 +622,7 @@ _brew ()
|
|||||||
install|instal|reinstall) _brew_install ;;
|
install|instal|reinstall) _brew_install ;;
|
||||||
irb) _brew_irb ;;
|
irb) _brew_irb ;;
|
||||||
link|ln) _brew_link ;;
|
link|ln) _brew_link ;;
|
||||||
linkapps) _brew_linkapps ;;
|
linkapps|unlinkapps) _brew_linkapps ;;
|
||||||
list|ls) _brew_list ;;
|
list|ls) _brew_list ;;
|
||||||
log) _brew_log ;;
|
log) _brew_log ;;
|
||||||
man) _brew_man ;;
|
man) _brew_man ;;
|
||||||
|
|||||||
@ -51,6 +51,7 @@ _1st_arguments=(
|
|||||||
'reinstall:install a formula anew; re-using its current options'
|
'reinstall:install a formula anew; re-using its current options'
|
||||||
'leaves:show installed formulae that are not dependencies of another installed formula'
|
'leaves:show installed formulae that are not dependencies of another installed formula'
|
||||||
'link:link a formula'
|
'link:link a formula'
|
||||||
|
'linkapps:symlink .app bundles provided by formulae into /Applications'
|
||||||
'list:list files in a formula or not-installed formulae'
|
'list:list files in a formula or not-installed formulae'
|
||||||
'log:git commit log for a formula'
|
'log:git commit log for a formula'
|
||||||
'missing:check all installed formuale for missing dependencies.'
|
'missing:check all installed formuale for missing dependencies.'
|
||||||
@ -69,6 +70,7 @@ _1st_arguments=(
|
|||||||
'test-bot:test a formula and build a bottle'
|
'test-bot:test a formula and build a bottle'
|
||||||
'uninstall:uninstall a formula'
|
'uninstall:uninstall a formula'
|
||||||
'unlink:unlink a formula'
|
'unlink:unlink a formula'
|
||||||
|
'unlinkapps:remove symlinked .app bundles provided by formulae from /Applications'
|
||||||
'unpin:unpin specified formulae'
|
'unpin:unpin specified formulae'
|
||||||
'untap:remove a tapped repository'
|
'untap:remove a tapped repository'
|
||||||
'update:fetch latest version of Homebrew and all formulae'
|
'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)
|
install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|desc|edit|options|switch)
|
||||||
_brew_all_formulae
|
_brew_all_formulae
|
||||||
_wanted formulae expl 'all formulae' compadd -a 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)
|
list|ls)
|
||||||
_arguments \
|
_arguments \
|
||||||
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user