Add version number to cask JSON option
`$ brew cask info --json=v1 <formula>` instead of `$ brew cask info --json <formula>`
This commit is contained in:
parent
b548dbde97
commit
7e5addfb22
@ -3,7 +3,7 @@ require "json"
|
|||||||
module Hbc
|
module Hbc
|
||||||
class CLI
|
class CLI
|
||||||
class Info < AbstractCommand
|
class Info < AbstractCommand
|
||||||
option "--json-v1", :json, false
|
option "--json=VERSION", :json
|
||||||
|
|
||||||
def initialize(*)
|
def initialize(*)
|
||||||
super
|
super
|
||||||
@ -11,9 +11,8 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
if json?
|
if json == "v1"
|
||||||
json = casks.map(&:to_hash)
|
puts JSON.generate(casks.map(&:to_hash))
|
||||||
puts JSON.generate(json)
|
|
||||||
else
|
else
|
||||||
casks.each do |cask|
|
casks.each do |cask|
|
||||||
odebug "Getting info for Cask #{cask}"
|
odebug "Getting info for Cask #{cask}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user