bash completion for doctor checks

This commit is contained in:
Jack Nagel 2012-11-13 16:49:43 -06:00
parent 4125fa8121
commit 6c4c37a01f
2 changed files with 11 additions and 0 deletions

View File

@ -136,6 +136,11 @@ _brew_deps ()
__brew_complete_formulae
}
_brew_doctor () {
local cur="${COMP_WORDS[COMP_CWORD]}"
__brewcomp "$(brew doctor --list-checks)"
}
_brew_diy ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@ -425,6 +430,7 @@ _brew ()
cleanup) _brew_cleanup ;;
create) _brew_create ;;
deps) _brew_deps ;;
doctor|dr) _brew_doctor ;;
diy|configure) _brew_diy ;;
fetch) _brew_fetch ;;
info|abv) _brew_info ;;

View File

@ -994,6 +994,11 @@ module Homebrew extend self
def doctor
checks = Checks.new
if ARGV.include? '--list-checks'
checks.methods.select { |m| m =~ /^check_/ }.sort.each { |m| puts m }
exit
end
inject_dump_stats(checks) if ARGV.switch? 'D'
methods = if ARGV.named.empty?