shell completion of official taps added to 'brew tap'
Closes Homebrew/homebrew#42421. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
b2c0ff3985
commit
3a733cad09
@ -140,6 +140,7 @@ _brew_complete_tap ()
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__brewcomp "$(brew tap --list-official)"
|
||||
}
|
||||
|
||||
_brew_bottle ()
|
||||
|
||||
@ -18,6 +18,10 @@ _brew_installed_taps() {
|
||||
installed_taps=(`brew tap`)
|
||||
}
|
||||
|
||||
_brew_official_taps() {
|
||||
official_taps=(`brew tap --list-official`)
|
||||
}
|
||||
|
||||
_brew_outdated_formulae() {
|
||||
outdated_formulae=(`brew outdated`)
|
||||
}
|
||||
@ -58,7 +62,7 @@ _1st_arguments=(
|
||||
)
|
||||
|
||||
local expl
|
||||
local -a formulae installed_formulae installed_taps outdated_formulae
|
||||
local -a formulae installed_formulae installed_taps official_taps outdated_formulae
|
||||
|
||||
_arguments \
|
||||
'(-v)-v[verbose]' \
|
||||
@ -100,6 +104,9 @@ case "$words[1]" in
|
||||
untap|tap-info)
|
||||
_brew_installed_taps
|
||||
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
|
||||
tap)
|
||||
_brew_official_taps
|
||||
_wanted official_taps expl 'official taps' compadd -a official_taps ;;
|
||||
upgrade)
|
||||
_brew_outdated_formulae
|
||||
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
|
||||
|
||||
@ -6,6 +6,9 @@ module Homebrew
|
||||
puts Tap.names
|
||||
elsif ARGV.first == "--repair"
|
||||
migrate_taps :force => true
|
||||
elsif ARGV.first == "--list-official"
|
||||
require "official_taps"
|
||||
puts OFFICIAL_TAPS.map { |t| "homebrew/#{t}" } * "\n"
|
||||
else
|
||||
user, repo = tap_args
|
||||
clone_target = ARGV.named[1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user