Merge pull request #5837 from EricFromCanada/json-v1-default

outdated & tap-info: set default value for --json
This commit is contained in:
Mike McQuaid 2019-03-05 08:38:22 +00:00 committed by GitHub
commit d9b43928f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 16 deletions

View File

@ -19,15 +19,16 @@ module Homebrew
description: "List only the names of outdated brews (takes precedence over `--verbose`)."
switch :verbose,
description: "Display detailed version information."
flag "--json=",
description: "Show output in JSON format for provided <version>. Currently the only "\
"accepted value of <version> is `v1`."
flag "--json",
description: "Print output in JSON format. Currently the default and only accepted "\
"value for <version> is `v1`. See the docs for examples of using the JSON "\
"output: <https://docs.brew.sh/Querying-Brew>"
switch "--fetch-HEAD",
description: "Fetch the upstream repository to detect if the HEAD installation of the "\
"formula is outdated. Otherwise, the repository's HEAD will be checked for "\
"updates when a new stable or development version has been released."
switch :debug
conflicts "--quiet", "--verbose", "--json="
conflicts "--quiet", "--verbose", "--json"
end
end
@ -39,7 +40,9 @@ module Homebrew
else
ARGV.resolved_formulae
end
if args.json == "v1"
if args.json
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
outdated = print_outdated_json(formulae)
else
outdated = print_outdated(formulae)

View File

@ -13,10 +13,10 @@ module Homebrew
EOS
switch "--installed",
description: "Display information on all installed taps."
flag "--json=",
description: "Print a JSON representation of <taps>. Currently the only accepted value for "\
"<version> is `v1`. See the docs for examples of using the JSON output: "\
"<https://docs.brew.sh/Querying-Brew>"
flag "--json",
description: "Print a JSON representation of <taps>. Currently the default and only accepted "\
"value for <version> is `v1`. See the docs for examples of using the JSON "\
"output: <https://docs.brew.sh/Querying-Brew>"
switch :debug
end
end
@ -32,7 +32,9 @@ module Homebrew
end
end
if args.json == "v1"
if args.json
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
print_tap_json(taps.sort_by(&:to_s))
else
print_tap_info(taps.sort_by(&:to_s))

View File

@ -339,7 +339,7 @@ By default, version information is displayed in interactive shells, and
suppressed otherwise.
* `--json`:
Show output in JSON format for provided *`version`*. Currently the only accepted value of *`version`* is `v1`.
Print output in JSON format. Currently the default and only accepted value for *`version`* is `v1`. See the docs for examples of using the JSON output: <https://docs.brew.sh/Querying-Brew>
* `--fetch-HEAD`:
Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will be checked for updates when a new stable or development version has been released.
@ -479,7 +479,7 @@ Display a brief summary of all installed taps if no *`tap`* are passed.
* `--installed`:
Display information on all installed taps.
* `--json`:
Print a JSON representation of *`taps`*. Currently the only accepted value for *`version`* is `v1`. See the docs for examples of using the JSON output: <https://docs.brew.sh/Querying-Brew>
Print a JSON representation of *`taps`*. Currently the default and only accepted value for *`version`* is `v1`. See the docs for examples of using the JSON output: <https://docs.brew.sh/Querying-Brew>
### `tap-pin` *`tap`*

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BREW\-CASK" "1" "February 2019" "Homebrew" "brew-cask"
.TH "BREW\-CASK" "1" "March 2019" "Homebrew" "brew-cask"
.
.SH "NAME"
\fBbrew\-cask\fR \- a friendly binary installer for macOS

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BREW" "1" "February 2019" "Homebrew" "brew"
.TH "BREW" "1" "March 2019" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for macOS
@ -438,7 +438,7 @@ By default, version information is displayed in interactive shells, and suppress
.
.TP
\fB\-\-json\fR
Show output in JSON format for provided \fIversion\fR\. Currently the only accepted value of \fIversion\fR is \fBv1\fR\.
Print output in JSON format\. Currently the default and only accepted value for \fIversion\fR is \fBv1\fR\. See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR
.
.TP
\fB\-\-fetch\-HEAD\fR
@ -603,7 +603,7 @@ Display information on all installed taps\.
.
.TP
\fB\-\-json\fR
Print a JSON representation of \fItaps\fR\. Currently the only accepted value for \fIversion\fR is \fBv1\fR\. See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR
Print a JSON representation of \fItaps\fR\. Currently the default and only accepted value for \fIversion\fR is \fBv1\fR\. See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR
.
.SS "\fBtap\-pin\fR \fItap\fR"
Pin \fItap\fR, prioritising its formulae over core when formula names are supplied by the user\. See also \fBtap\-unpin\fR\.