From 311c10636b0e5a86b7042d745afe782b19ed4659 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 25 Nov 2020 16:32:10 +0000 Subject: [PATCH] Deprecation fixes - `brew uninstall --zap` replaces `brew cask zap` - clarify how `--json` should behave Fixes https://github.com/Homebrew/brew/issues/9296 --- Library/Homebrew/cask/cmd.rb | 2 +- Library/Homebrew/cmd/info.rb | 8 +++++--- docs/Manpage.md | 2 +- manpages/brew.1 | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 76c14bcf6c..628ce65d91 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 80c8723438..7e23762270 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 in a browser. "\ "To view formula history locally: `brew log -p` " 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: " + description: "Print a JSON representation. Currently the default value for is `v1` for "\ + ". For and use `v2`. See the docs for examples of using the "\ + "JSON output: " 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 3d833eabed..6a9136cc82 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: + 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: * `--installed`: Print JSON of formulae that are currently installed. * `--all`: diff --git a/manpages/brew.1 b/manpages/brew.1 index d9777aad0d..e0e0cb953f 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