aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/info.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cmd/info.rb')
-rw-r--r--Library/Homebrew/cmd/info.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index 9deda9dfb..ef8e2ac52 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -41,8 +41,14 @@ module Homebrew extend self
end
def print_json
- formulae = ARGV.include?("--all") ? Formula : ARGV.formulae
- json = formulae.map {|f| f.to_hash}
+ ff = if ARGV.include? "--all"
+ Formula
+ elsif ARGV.include? "--installed"
+ Formula.installed
+ else
+ ARGV.formulae
+ end
+ json = ff.map {|f| f.to_hash}
if json.size == 1
puts Utils::JSON.dump(json.pop)
else