diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 0858eec572..dd469eb4ce 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -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 . Currently the only "\ - "accepted value of is `v1`." + flag "--json", + description: "Print output in JSON format. Currently the default and only accepted "\ + "value for is `v1`. See the docs for examples of using the JSON "\ + "output: " 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) diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index 6db14fcea0..b359c31581 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -13,10 +13,10 @@ module Homebrew EOS switch "--installed", description: "Display information on all installed taps." - flag "--json=", - description: "Print a JSON representation of . Currently the only accepted value for "\ - " is `v1`. See the docs for examples of using the JSON output: "\ - "" + flag "--json", + description: "Print a JSON representation of . Currently the default and only accepted "\ + "value for is `v1`. See the docs for examples of using the JSON "\ + "output: " 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)) diff --git a/docs/Manpage.md b/docs/Manpage.md index 0e5cef0a3d..b1c20e9156 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -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: * `--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: + 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: ### `tap-pin` *`tap`* diff --git a/manpages/brew-cask.1 b/manpages/brew-cask.1 index 3e5bbc21e0..dad16b8afb 100644 --- a/manpages/brew-cask.1 +++ b/manpages/brew-cask.1 @@ -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 diff --git a/manpages/brew.1 b/manpages/brew.1 index 9c1f684469..786bcac947 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -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\.