always use a top-level array for info JSON
Closes Homebrew/homebrew#29318.
This commit is contained in:
parent
16c073a153
commit
48a7981c78
@ -160,16 +160,15 @@ Note that these flags should only appear after a command.
|
|||||||
|
|
||||||
To view formula history locally: `brew log -p <formula>`.
|
To view formula history locally: `brew log -p <formula>`.
|
||||||
|
|
||||||
* `info --json=<version>` (--all|--installed|<formula>):
|
* `info --json=<version>` (--all|--installed|<formulae>):
|
||||||
Print a JSON representation of <formula>. Currently the only accepted value
|
Print a JSON representation of <formulae>. Currently the only accepted value
|
||||||
for <version> is `v1`.
|
for <version> is `v1`.
|
||||||
|
|
||||||
Pass `--all` to get information on all formulae, or `--installed` to get
|
Pass `--all` to get information on all formulae, or `--installed` to get
|
||||||
information on all installed formulae.
|
information on all installed formulae.
|
||||||
|
|
||||||
If a single formula is specified, a single JSON object is displayed.
|
See the wiki for examples of using the JSON:
|
||||||
If multiple formulae are specified, or `--installed` or `--all` are used,
|
<https://github.com/Homebrew/homebrew/wiki/Querying-Brew>
|
||||||
a JSON array is displayed, even if the array would only contain one object.
|
|
||||||
|
|
||||||
* `install [--debug] [--env=<std|super>] [--ignore-dependencies] [--only-dependencies] [--cc=<compiler>] [--build-from-source] [--devel|--HEAD]` <formula>:
|
* `install [--debug] [--env=<std|super>] [--ignore-dependencies] [--only-dependencies] [--cc=<compiler>] [--build-from-source] [--devel|--HEAD]` <formula>:
|
||||||
Install <formula>.
|
Install <formula>.
|
||||||
|
@ -49,11 +49,7 @@ module Homebrew extend self
|
|||||||
ARGV.formulae
|
ARGV.formulae
|
||||||
end
|
end
|
||||||
json = ff.map {|f| f.to_hash}
|
json = ff.map {|f| f.to_hash}
|
||||||
if json.size == 1
|
puts Utils::JSON.dump(json)
|
||||||
puts Utils::JSON.dump(json.pop)
|
|
||||||
else
|
|
||||||
puts Utils::JSON.dump(json)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def github_fork
|
def github_fork
|
||||||
|
@ -177,14 +177,14 @@ Open a browser to the GitHub History page for formula \fIformula\fR\.
|
|||||||
To view formula history locally: \fBbrew log \-p <formula>\fR\.
|
To view formula history locally: \fBbrew log \-p <formula>\fR\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBinfo \-\-json=<version>\fR (\-\-all|\-\-installed|\fIformula\fR)
|
\fBinfo \-\-json=<version>\fR (\-\-all|\-\-installed|\fIformulae\fR)
|
||||||
Print a JSON representation of \fIformula\fR\. Currently the only accepted value for \fIversion\fR is \fBv1\fR\.
|
Print a JSON representation of \fIformulae\fR\. Currently the only accepted value for \fIversion\fR is \fBv1\fR\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
Pass \fB\-\-all\fR to get information on all formulae, or \fB\-\-installed\fR to get information on all installed formulae\.
|
Pass \fB\-\-all\fR to get information on all formulae, or \fB\-\-installed\fR to get information on all installed formulae\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
If a single formula is specified, a single JSON object is displayed\. If multiple formulae are specified, or \fB\-\-installed\fR or \fB\-\-all\fR are used, a JSON array is displayed, even if the array would only contain one object\.
|
See the wiki for examples of using the JSON: \fIhttps://github\.com/Homebrew/homebrew/wiki/Querying\-Brew\fR
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBinstall [\-\-debug] [\-\-env=<std|super>] [\-\-ignore\-dependencies] [\-\-only\-dependencies] [\-\-cc=<compiler>] [\-\-build\-from\-source] [\-\-devel|\-\-HEAD]\fR \fIformula\fR
|
\fBinstall [\-\-debug] [\-\-env=<std|super>] [\-\-ignore\-dependencies] [\-\-only\-dependencies] [\-\-cc=<compiler>] [\-\-build\-from\-source] [\-\-devel|\-\-HEAD]\fR \fIformula\fR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user