diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 76c14bcf6cf76eab0348e85850fb8784dfd7598b..628ce65d916da8db2378527ebda21f4a6aa4bec4 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -71,7 +71,7 @@ module Cask Cmd::Style => "brew style", Cmd::Uninstall => "brew uninstall [--cask]", Cmd::Upgrade => "brew upgrade [--cask]", - Cmd::Zap => "brew upgrade --zap [--cask]", + Cmd::Zap => "brew uninstall --zap [--cask]", }.freeze def self.parser(&block) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 80c8723438707a5c9d6aa8c2d54eedbd889450e5..7e237622703103d37601bc61ba998c872b51cf69 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -49,9 +49,9 @@ module Homebrew description: "Open the GitHub source page for <formula> in a browser. "\ "To view formula history locally: `brew log -p` <formula>" flag "--json", - description: "Print a JSON representation of <formula>. 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>" + description: "Print a JSON representation. Currently the default value for <version> is `v1` for "\ + "<formula>. For <formula> and <cask> use `v2`. See the docs for examples of using the "\ + "JSON output: <https://docs.brew.sh/Querying-Brew>" switch "--installed", depends_on: "--json", description: "Print JSON of formulae that are currently installed." @@ -178,6 +178,8 @@ module Homebrew json = case json_version(args.json) when :v1, :default + raise UsageError, "cannot specify --cask with --json=v1!" if args.cask? + formulae = if args.all? Formula.sort elsif args.installed? diff --git a/docs/Manpage.md b/docs/Manpage.md index 3d833eabed8c085940b9b81c37c6e6224cfee429..6a9136cc8209800cb7bfaca0345d127e30a36c9d 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -222,7 +222,7 @@ If a *`formula`* or *`cask`* is provided, show summary of information about it. * `--github`: Open the GitHub source page for *`formula`* in a browser. To view formula history locally: `brew log -p` *`formula`* * `--json`: - Print a JSON representation of *`formula`*. 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> + Print a JSON representation. Currently the default value for *`version`* is `v1` for *`formula`*. For *`formula`* and *`cask`* use `v2`. See the docs for examples of using the JSON output: <https://docs.brew.sh/Querying-Brew> * `--installed`: Print JSON of formulae that are currently installed. * `--all`: diff --git a/manpages/brew.1 b/manpages/brew.1 index d9777aad0da42aa9d4787492008ac695360f9cff..e0e0cb953f5525a2829a55ca6cf78f72eecf6525 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -274,7 +274,7 @@ Open the GitHub source page for \fIformula\fR in a browser\. To view formula his . .TP \fB\-\-json\fR -Print a JSON representation of \fIformula\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 +Print a JSON representation\. Currently the default value for \fIversion\fR is \fBv1\fR for \fIformula\fR\. For \fIformula\fR and \fIcask\fR use \fBv2\fR\. See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR . .TP \fB\-\-installed\fR