diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 7513e3c4f6..c4aeeaf841 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -28,7 +28,7 @@ _brew_to_completion() case "$prev" in # Commands that take a formula - cat|deps|edit|fetch|home|homepage|info|install|log|options|uses) + cat|deps|edit|fetch|home|homepage|info|install|log|missing|options|uses) # handle standard --options if [[ "$prev" == "install" && "$cur" == --* ]]; then local opts=$( diff --git a/Library/Contributions/examples/brew-missing.rb b/Library/Contributions/examples/brew-missing.rb index 701bb1ca28..5beca3c92b 100755 --- a/Library/Contributions/examples/brew-missing.rb +++ b/Library/Contributions/examples/brew-missing.rb @@ -1,18 +1,29 @@ require "formula" require "cmd/outdated" +def installed_brews + formulae = [] + HOMEBREW_CELLAR.subdirs.each do |rack| + f = Formula.factory rack.basename.to_s rescue nil + formulae << f if f and f.installed? + end + formulae +end + def main # Names of outdated brews; they count as installed. outdated = Homebrew.outdated_brews.collect{ |b| b[1] } - HOMEBREW_CELLAR.subdirs.each do |rack| - f = Formula.factory rack.basename.to_s rescue nil - if f and f.installed? - missing_deps = f.recursive_deps.map{ |g| g.name }.uniq.reject do |dep_name| - Formula.factory(dep_name).installed? or outdated.include?(dep_name) - end + formuale_to_check = ARGV.formulae rescue installed_brews - puts "#{f.name}: #{missing_deps * ', '}" unless missing_deps.empty? + formuale_to_check.each do |f| + missing_deps = f.recursive_deps.map{ |g| g.name }.uniq.reject do |dep_name| + Formula.factory(dep_name).installed? or outdated.include?(dep_name) + end + + unless missing_deps.empty? + print "#{f.name}: " if formuale_to_check.size > 1 + puts "#{missing_deps * ', '}" end end end diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index f65168bef8..409eab697f 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -179,8 +179,10 @@ didn't include with OS X. If `--all` is passed, show options for all formulae. - * `missing`: - Check all installed formuale for missing dependencies. + * `missing` []: + Check the given for missing dependencies. + + If no are given, check all installed brews. * `server`: Start a local web app that lets you browse available formulae, similar diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1 index 24ac5ffa1d..ed8a909dcb 100644 --- a/share/man/man1/brew.1 +++ b/share/man/man1/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "March 2011" "Homebrew" "brew" +.TH "BREW" "1" "April 2011" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The missing package manager for OS X @@ -198,8 +198,11 @@ If \fB\-\-compact\fR is passed, show all options on a single line separated by s If \fB\-\-all\fR is passed, show options for all formulae\. . .TP -\fBmissing\fR -Check all installed formuale for missing dependencies\. +\fBmissing\fR [\fIformulae\fR] +Check the given \fIformulae\fR for missing dependencies\. +. +.IP +If no \fIformulae\fR are given, check all installed brews\. . .TP \fBserver\fR