diff options
| author | Adam Vandenberg | 2014-05-16 08:47:09 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-05-16 09:03:12 -0700 |
| commit | d9ed121c4667c913b4bb8a664c54b2285f5a3046 (patch) | |
| tree | b3b64b4a4799d12946d66af5394a0b3da229837b /Library/Homebrew/cmd | |
| parent | 99ebf05b9cf28ed7dbeb7114189b9cfbc4e5cf22 (diff) | |
| download | brew-d9ed121c4667c913b4bb8a664c54b2285f5a3046.tar.bz2 | |
add --installed to json info
Closes Homebrew/homebrew#29315.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 10 |
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 |
