Browse files

bash completion for doctor checks

  • Loading branch information...
1 parent b7661f3 commit 976366e5ed80fe456a1b7b5b67137a9c694a1a2f @jacknagel jacknagel committed Nov 13, 2012
Showing with 11 additions and 0 deletions.
  1. +6 −0 Library/Contributions/brew_bash_completion.sh
  2. +5 −0 Library/Homebrew/cmd/doctor.rb
View
6 Library/Contributions/brew_bash_completion.sh
@@ -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
5 Library/Homebrew/cmd/doctor.rb
@@ -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?

0 comments on commit 976366e

Please sign in to comment.