aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2010-03-09 02:13:33 +0000
committerAdam Vandenberg2010-07-18 13:52:01 -0700
commitbc5ee7c482396af3a1f15cd851df0c8390836f89 (patch)
treeb1756af6e2e8af23e8f813728dc00028dfa520c4
parenta496ca016646538351d6ff2cd3eb08d22fc5d19e (diff)
downloadbrew-bc5ee7c482396af3a1f15cd851df0c8390836f89.tar.bz2
brew.h info takes a formula parameter rather than a string
* Preference is for commands to take instantiated formulae as parameters rather than formula names, so alias resolution can be centralized.
-rw-r--r--Library/Homebrew/brew.h.rb7
-rwxr-xr-xbin/brew2
2 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 1742c6607..a8c8c365f 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -185,12 +185,9 @@ def github_info name
return "http://github.com/#{user}/homebrew/commits/#{branch}/Library/Formula/#{formula_name}"
end
-def info name
- require 'formula'
-
+def info f
exec 'open', github_info(name) if ARGV.flag? '--github'
- f=Formula.factory name
puts "#{f.name} #{f.version}"
puts f.homepage
@@ -213,7 +210,7 @@ def info name
puts
end
- history = github_info(name)
+ history = github_info(f.name)
puts history if history
rescue FormulaUnavailableError
diff --git a/bin/brew b/bin/brew
index 00a7a80b8..9420fbb2e 100755
--- a/bin/brew
+++ b/bin/brew
@@ -243,7 +243,7 @@ begin
elsif ARGV[0][0..6] == 'http://'
puts Pathname.new(ARGV.shift).version
else
- ARGV.named.each {|name| info name}
+ ARGV.formulae.each{ |f| info f }
end
when 'cleanup'