From 3c2ec1c60f942ef7fe935ddf92272fc91c094306 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 18 Nov 2020 08:10:21 +0100 Subject: [PATCH 1/2] Deprecate remaining cask commands. --- Library/Homebrew/cask/cmd.rb | 20 ++++-- Library/Homebrew/cask/cmd/edit.rb | 4 +- Library/Homebrew/cask/cmd/uninstall.rb | 2 +- Library/Homebrew/cask/dsl/caveats.rb | 6 +- Library/Homebrew/cask/exceptions.rb | 4 +- Library/Homebrew/cask/installer.rb | 2 +- Library/Homebrew/cmd/home.rb | 10 +-- Library/Homebrew/cmd/update-report.rb | 8 +-- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 30 ++++---- .../Homebrew/extend/os/mac/missing_formula.rb | 8 +-- Library/Homebrew/missing_formula.rb | 6 +- Library/Homebrew/requirement.rb | 4 +- .../Homebrew/requirements/java_requirement.rb | 2 +- Library/Homebrew/test/cask/cmd_spec.rb | 4 ++ Library/Homebrew/test/missing_formula_spec.rb | 6 +- .../requirements/java_requirement_spec.rb | 6 +- docs/Manpage.md | 42 ++--------- manpages/brew.1 | 70 ++----------------- 18 files changed, 81 insertions(+), 153 deletions(-) diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index f789cc374..a51b6f089 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -54,13 +54,23 @@ module Cask }.freeze DEPRECATED_COMMANDS = { - Cmd::Cache => "brew --cache --cask", + Cmd::Cache => "brew --cache [--cask]", + Cmd::Audit => "brew audit [--cask]", + Cmd::Cat => "brew cat [--cask]", + Cmd::Create => "brew create --cask --set-name ", Cmd::Doctor => "brew doctor --verbose", + Cmd::Edit => "brew edit [--cask]", + Cmd::Fetch => "brew fetch [--cask]", Cmd::Home => "brew home", - Cmd::List => "brew list --cask", - Cmd::Outdated => "brew outdated --cask", - Cmd::Reinstall => "brew reinstall", - Cmd::Upgrade => "brew upgrade --cask", + Cmd::Info => "brew info [--cask]", + Cmd::Install => "brew install [--cask]", + Cmd::List => "brew list [--cask]", + Cmd::Outdated => "brew outdated [--cask]", + Cmd::Reinstall => "brew reinstall [--cask]", + Cmd::Style => "brew style", + Cmd::Uninstall => "brew uninstall [--cask]", + Cmd::Upgrade => "brew upgrade [--cask]", + Cmd::Zap => "brew upgrade --zap [--cask]", }.freeze sig { returns(String) } diff --git a/Library/Homebrew/cask/cmd/edit.rb b/Library/Homebrew/cask/cmd/edit.rb index ca01e711c..8036352a3 100644 --- a/Library/Homebrew/cask/cmd/edit.rb +++ b/Library/Homebrew/cask/cmd/edit.rb @@ -35,7 +35,9 @@ module Cask exec_editor cask_path rescue CaskUnavailableError => e reason = e.reason.empty? ? +"" : +"#{e.reason} " - reason.concat("Run #{Formatter.identifier("brew cask create #{e.token}")} to create a new Cask.") + reason.concat( + "Run #{Formatter.identifier("brew create --cask --set-name #{e.token} ")} to create a new Cask.", + ) raise e.class.new(e.token, reason.freeze) end diff --git a/Library/Homebrew/cask/cmd/uninstall.rb b/Library/Homebrew/cask/cmd/uninstall.rb index 4fd6ac898..6a70b9b77 100644 --- a/Library/Homebrew/cask/cmd/uninstall.rb +++ b/Library/Homebrew/cask/cmd/uninstall.rb @@ -64,7 +64,7 @@ module Cask puts <<~EOS #{cask} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed. - Remove #{(versions.count == 1) ? "it" : "them all"} with `brew cask uninstall --force #{cask}`. + Remove #{(versions.count == 1) ? "it" : "them all"} with `brew uninstall --cask --force #{cask}`. EOS end end diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index 9673fbc36..705a6b35c 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -112,17 +112,17 @@ module Cask if java_version == :any <<~EOS #{@cask} requires Java. You can install the latest version with: - brew cask install adoptopenjdk + brew install --cask adoptopenjdk EOS elsif java_version.include?("11") || java_version.include?("+") <<~EOS #{@cask} requires Java #{java_version}. You can install the latest version with: - brew cask install adoptopenjdk + brew install --cask adoptopenjdk EOS else <<~EOS #{@cask} requires Java #{java_version}. You can install it with: - brew cask install homebrew/cask-versions/adoptopenjdk#{java_version} + brew install --cask homebrew/cask-versions/adoptopenjdk#{java_version} EOS end end diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index 9778c2972..34cd2b62a 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -111,7 +111,7 @@ module Cask sig { returns(String) } def to_s - %Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew cask edit #{token}")} to edit it.) + %Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.) end end @@ -142,7 +142,7 @@ module Cask def to_s <<~EOS Cask '#{token}' requires XQuartz/X11, which can be installed using Homebrew Cask by running: - #{Formatter.identifier("brew cask install xquartz")} + #{Formatter.identifier("brew install --cask xquartz")} or manually, by downloading the package from: #{Formatter.url("https://www.xquartz.org/")} diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 23eda92fe..c93530ede 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -474,7 +474,7 @@ module Cask end def zap - ohai %Q(Implied "brew cask uninstall #{@cask}") + ohai %Q(Implied "brew uninstall --cask #{@cask}") uninstall_artifacts if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty? opoo "No zap stanza present for Cask '#{@cask}'" diff --git a/Library/Homebrew/cmd/home.rb b/Library/Homebrew/cmd/home.rb index 230839296..2dfa1c8f4 100644 --- a/Library/Homebrew/cmd/home.rb +++ b/Library/Homebrew/cmd/home.rb @@ -1,7 +1,8 @@ -# typed: false +# typed: true # frozen_string_literal: true require "cli/parser" +require "formula" module Homebrew extend T::Sig @@ -12,14 +13,15 @@ module Homebrew def home_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `home` [] + `home` [|] - Open 's homepage in a browser, or open Homebrew's own homepage - if no formula is provided. + Open a or 's homepage in a browser, or open + Homebrew's own homepage if no argument is provided. EOS end end + sig { void } def home args = home_args.parse diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 24406a476..76d563a95 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -322,7 +322,7 @@ class Reporter new_tap.install unless new_tap.installed? ohai "#{name} has been moved to Homebrew.", <<~EOS To uninstall the cask run: - brew cask uninstall --force #{name} + brew uninstall --cask --force #{name} EOS next if (HOMEBREW_CELLAR/new_name.split("/").last).directory? @@ -352,8 +352,8 @@ class Reporter system HOMEBREW_BREW_FILE, "unlink", name ohai "brew cleanup" system HOMEBREW_BREW_FILE, "cleanup" - ohai "brew cask install #{new_name}" - system HOMEBREW_BREW_FILE, "cask", "install", new_name + ohai "brew install --cask #{new_name}" + system HOMEBREW_BREW_FILE, "install", "--cask", new_name ohai <<~EOS #{name} has been moved to Homebrew Cask. The existing keg has been unlinked. @@ -365,7 +365,7 @@ class Reporter To uninstall the formula and install the cask run: brew uninstall --force #{name} brew tap #{new_tap_name} - brew cask install #{new_name} + brew install --cask #{new_name} EOS end else diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 032a8df0a..f34f0c762 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -30,11 +30,11 @@ module Homebrew description: "When passed with `--write`, generate a new commit after writing changes "\ "to the cask file." switch "--no-audit", - description: "Don't run `brew cask audit` before opening the PR." + description: "Don't run `brew audit` before opening the PR." switch "--online", - description: "Run `brew cask audit --online` before opening the PR." + description: "Run `brew audit --online` before opening the PR." switch "--no-style", - description: "Don't run `brew cask style --fix` before opening the PR." + description: "Don't run `brew style --fix` before opening the PR." switch "--no-browse", description: "Print the pull request URL instead of opening in a browser." switch "--no-fork", @@ -232,49 +232,49 @@ module Homebrew def run_cask_audit(cask, old_contents, args:) if args.dry_run? if args.no_audit? - ohai "Skipping `brew cask audit`" + ohai "Skipping `brew audit`" elsif args.online? - ohai "brew cask audit --online #{cask.sourcefile_path.basename}" + ohai "brew audit --cask --online #{cask.sourcefile_path.basename}" else - ohai "brew cask audit #{cask.sourcefile_path.basename}" + ohai "brew audit --cask #{cask.sourcefile_path.basename}" end return end failed_audit = false if args.no_audit? - ohai "Skipping `brew cask audit`" + ohai "Skipping `brew audit`" elsif args.online? - system HOMEBREW_BREW_FILE, "cask", "audit", "--online", cask.sourcefile_path + system HOMEBREW_BREW_FILE, "audit", "--cask", "--online", cask.sourcefile_path failed_audit = !$CHILD_STATUS.success? else - system HOMEBREW_BREW_FILE, "cask", "audit", cask.sourcefile_path + system HOMEBREW_BREW_FILE, "audit", "--cask", cask.sourcefile_path failed_audit = !$CHILD_STATUS.success? end return unless failed_audit cask.sourcefile_path.atomic_write(old_contents) - odie "`brew cask audit` failed!" + odie "`brew audit` failed!" end def run_cask_style(cask, old_contents, args:) if args.dry_run? if args.no_style? - ohai "Skipping `brew cask style --fix`" + ohai "Skipping `brew style --fix`" else - ohai "brew cask style --fix #{cask.sourcefile_path.basename}" + ohai "brew style --fix #{cask.sourcefile_path.basename}" end return end failed_style = false if args.no_style? - ohai "Skipping `brew cask style --fix`" + ohai "Skipping `brew style --fix`" else - system HOMEBREW_BREW_FILE, "cask", "style", "--fix", cask.sourcefile_path + system HOMEBREW_BREW_FILE, "style", "--fix", cask.sourcefile_path failed_style = !$CHILD_STATUS.success? end return unless failed_style cask.sourcefile_path.atomic_write(old_contents) - odie "`brew cask style --fix` failed!" + odie "`brew style --fix` failed!" end end diff --git a/Library/Homebrew/extend/os/mac/missing_formula.rb b/Library/Homebrew/extend/os/mac/missing_formula.rb index 37ec0c027..7ad5199b5 100644 --- a/Library/Homebrew/extend/os/mac/missing_formula.rb +++ b/Library/Homebrew/extend/os/mac/missing_formula.rb @@ -23,13 +23,13 @@ module Homebrew There are three versions of MacTeX. Full installation: - brew cask install mactex + brew install --cask mactex Full installation without bundled applications: - brew cask install mactex-no-gui + brew install --cask mactex-no-gui Minimal installation: - brew cask install basictex + brew install --cask basictex EOS else generic_disallowed_reason(name) @@ -47,7 +47,7 @@ module Homebrew def suggest_command(name, command) suggestion = <<~EOS Found a cask named "#{name}" instead. Try - brew cask #{command} #{name} + brew #{command} --cask #{name} EOS case command diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 958602973..cb044513e 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -30,7 +30,7 @@ module Homebrew EOS when "macruby" then <<~EOS MacRuby has been discontinued. Consider RubyMotion: - brew cask install rubymotion + brew install --cask rubymotion EOS when /(lib)?lzma/ then <<~EOS lzma is now part of the xz formula: @@ -74,8 +74,8 @@ module Homebrew when "ngrok" then <<~EOS Upstream sunsetted 1.x in March 2016 and 2.x is not open-source. - If you wish to use the 2.x release you can install with Homebrew Cask: - brew cask install ngrok + If you wish to use the 2.x release you can install it with: + brew install --cask ngrok EOS when "cargo" then <<~EOS cargo is part of the rust formula: diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 5078ac7bd..11a87bc43 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -43,8 +43,8 @@ class Requirement s = "#{class_name} unsatisfied!\n" if cask s += <<~EOS - You can install with Homebrew Cask: - brew cask install #{cask} + You can install the necessary cask with: + brew install --cask #{cask} EOS end diff --git a/Library/Homebrew/requirements/java_requirement.rb b/Library/Homebrew/requirements/java_requirement.rb index fdee4f4e0..cf6b944d4 100644 --- a/Library/Homebrew/requirements/java_requirement.rb +++ b/Library/Homebrew/requirements/java_requirement.rb @@ -75,7 +75,7 @@ class JavaRequirement < Requirement title_string = " #{title}" if title <<~EOS Install#{title_string} with Homebrew Cask: - brew cask install #{token} + brew install --cask #{token} EOS end end diff --git a/Library/Homebrew/test/cask/cmd_spec.rb b/Library/Homebrew/test/cask/cmd_spec.rb index d034437fc..36b55ebbd 100644 --- a/Library/Homebrew/test/cask/cmd_spec.rb +++ b/Library/Homebrew/test/cask/cmd_spec.rb @@ -11,6 +11,10 @@ describe Cask::Cmd, :cask do context "::run" do let(:noop_command) { double("Cmd::Noop", run: nil) } + before do + allow(Homebrew).to receive(:raise_deprecation_exceptions?).and_return(false) + end + it "prints help output when subcommand receives `--help` flag" do expect { described_class.run("info", "--help") diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 56985f347..e6b2dd644 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -97,7 +97,7 @@ describe Homebrew::MissingFormula do let(:show_info) { false } it { is_expected.to match(/Found a cask named "local-caffeine" instead./) } - it { is_expected.to match(/Try\n brew cask install local-caffeine/) } + it { is_expected.to match(/Try\n brew install --cask local-caffeine/) } end context "with a formula name that is a cask and show_info: true" do @@ -123,7 +123,7 @@ describe Homebrew::MissingFormula do let(:command) { "install" } it { is_expected.to match(/Found a cask named "local-caffeine" instead./) } - it { is_expected.to match(/Try\n brew cask install local-caffeine/) } + it { is_expected.to match(/Try\n brew install --cask local-caffeine/) } end context "brew uninstall" do @@ -138,7 +138,7 @@ describe Homebrew::MissingFormula do end it { is_expected.to match(/Found a cask named "local-caffeine" instead./) } - it { is_expected.to match(/Try\n brew cask uninstall local-caffeine/) } + it { is_expected.to match(/Try\n brew uninstall --cask local-caffeine/) } end end diff --git a/Library/Homebrew/test/requirements/java_requirement_spec.rb b/Library/Homebrew/test/requirements/java_requirement_spec.rb index a33c25928..95835ce2f 100644 --- a/Library/Homebrew/test/requirements/java_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/java_requirement_spec.rb @@ -138,21 +138,21 @@ describe JavaRequirement do describe "#suggestion" do context "without specific version" do - its(:suggestion) { is_expected.to match(/brew cask install adoptopenjdk/) } + its(:suggestion) { is_expected.to match(/brew install --cask adoptopenjdk/) } its(:cask) { is_expected.to eq("adoptopenjdk") } end context "with version 1.8" do subject { described_class.new(%w[1.8]) } - its(:suggestion) { is_expected.to match(%r{brew cask install homebrew/cask-versions/adoptopenjdk8}) } + its(:suggestion) { is_expected.to match(%r{brew install --cask homebrew/cask-versions/adoptopenjdk8}) } its(:cask) { is_expected.to eq("homebrew/cask-versions/adoptopenjdk8") } end context "with version 1.8+" do subject { described_class.new(%w[1.8+]) } - its(:suggestion) { is_expected.to match(/brew cask install adoptopenjdk/) } + its(:suggestion) { is_expected.to match(/brew install --cask adoptopenjdk/) } its(:cask) { is_expected.to eq("adoptopenjdk") } end end diff --git a/docs/Manpage.md b/docs/Manpage.md index 9e25a8c0c..261f8dee8 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -71,39 +71,9 @@ Homebrew Cask provides a friendly CLI workflow for the administration of macOS a Commands: -- `audit` -
Check *`cask`* for Homebrew coding style violations. - -- `cat` -
Dump raw source of a *`cask`* to the standard output. - -- `create` -
Creates the given *`cask`* and opens it in an editor. - -- `edit` -
Open the given *`cask`* for editing. - -- `fetch` -
Downloads remote application files to local cache. - - `help`
Print help for `cask` commands. -- `info` -
Displays information about the given *`cask`*. - -- `install` -
Installs the given *`cask`*. - -- `style` -
Checks style of the given *`cask`* using RuboCop. - -- `uninstall` -
Uninstalls the given *`cask`*. - -- `zap` -
Zaps all files associated with the given *`cask`*. - See also: `man brew` ### `cleanup` [*`options`*] [*`formula`*|*`cask`*] @@ -243,10 +213,10 @@ error message if no logs are found. * `-p`, `--private`: The Gist will be marked private and will not appear in listings but will be accessible with its link. -### `home` [*`formula`*] +### `home` [*`formula`*|*`cask`*] -Open *`formula`*'s homepage in a browser, or open Homebrew's own homepage -if no formula is provided. +Open a *`formula`* or *`cask`*'s homepage in a browser, or open +Homebrew's own homepage if no argument is provided. ### `info` [*`options`*] [*`formula`*|*`cask`*] @@ -849,11 +819,11 @@ supplied by the user. * `--commit`: When passed with `--write`, generate a new commit after writing changes to the cask file. * `--no-audit`: - Don't run `brew cask audit` before opening the PR. + Don't run `brew audit` before opening the PR. * `--online`: - Run `brew cask audit --online` before opening the PR. + Run `brew audit --online` before opening the PR. * `--no-style`: - Don't run `brew cask style --fix` before opening the PR. + Don't run `brew style --fix` before opening the PR. * `--no-browse`: Print the pull request URL instead of opening in a browser. * `--no-fork`: diff --git a/manpages/brew.1 b/manpages/brew.1 index ffa16f11d..a2becbf84 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -67,71 +67,11 @@ Homebrew Cask provides a friendly CLI workflow for the administration of macOS a Commands: . .TP -\fBaudit\fR -. -.br -Check \fIcask\fR for Homebrew coding style violations\. -. -.TP -\fBcat\fR -. -.br -Dump raw source of a \fIcask\fR to the standard output\. -. -.TP -\fBcreate\fR -. -.br -Creates the given \fIcask\fR and opens it in an editor\. -. -.TP -\fBedit\fR -. -.br -Open the given \fIcask\fR for editing\. -. -.TP -\fBfetch\fR -. -.br -Downloads remote application files to local cache\. -. -.TP \fBhelp\fR . .br Print help for \fBcask\fR commands\. . -.TP -\fBinfo\fR -. -.br -Displays information about the given \fIcask\fR\. -. -.TP -\fBinstall\fR -. -.br -Installs the given \fIcask\fR\. -. -.TP -\fBstyle\fR -. -.br -Checks style of the given \fIcask\fR using RuboCop\. -. -.TP -\fBuninstall\fR -. -.br -Uninstalls the given \fIcask\fR\. -. -.TP -\fBzap\fR -. -.br -Zaps all files associated with the given \fIcask\fR\. -. .P See also: \fBman brew\fR . @@ -322,8 +262,8 @@ Automatically create a new issue in the appropriate GitHub repository after crea \fB\-p\fR, \fB\-\-private\fR The Gist will be marked private and will not appear in listings but will be accessible with its link\. . -.SS "\fBhome\fR [\fIformula\fR]" -Open \fIformula\fR\'s homepage in a browser, or open Homebrew\'s own homepage if no formula is provided\. +.SS "\fBhome\fR [\fIformula\fR|\fIcask\fR]" +Open a \fIformula\fR or \fIcask\fR\'s homepage in a browser, or open Homebrew\'s own homepage if no argument is provided\. . .SS "\fBinfo\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]" Display brief statistics for your Homebrew installation\. @@ -1173,15 +1113,15 @@ When passed with \fB\-\-write\fR, generate a new commit after writing changes to . .TP \fB\-\-no\-audit\fR -Don\'t run \fBbrew cask audit\fR before opening the PR\. +Don\'t run \fBbrew audit\fR before opening the PR\. . .TP \fB\-\-online\fR -Run \fBbrew cask audit \-\-online\fR before opening the PR\. +Run \fBbrew audit \-\-online\fR before opening the PR\. . .TP \fB\-\-no\-style\fR -Don\'t run \fBbrew cask style \-\-fix\fR before opening the PR\. +Don\'t run \fBbrew style \-\-fix\fR before opening the PR\. . .TP \fB\-\-no\-browse\fR From b484f70572c1bf78e406bf3f2623a3ce99fb2e46 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 25 Nov 2020 09:37:21 +0000 Subject: [PATCH 2/2] Remove `cask` from `man brew`. --- Library/Homebrew/cask/cmd.rb | 25 ++++--------------------- Library/Homebrew/commands.rb | 7 +++++-- Library/Homebrew/dev-cmd/man.rb | 2 +- docs/Manpage.md | 11 ----------- manpages/brew.1 | 15 --------------- 5 files changed, 10 insertions(+), 50 deletions(-) diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index a51b6f089..76c14bcf6 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -61,6 +61,7 @@ module Cask Cmd::Doctor => "brew doctor --verbose", Cmd::Edit => "brew edit [--cask]", Cmd::Fetch => "brew fetch [--cask]", + Cmd::Help => "brew help", Cmd::Home => "brew home", Cmd::Info => "brew info [--cask]", Cmd::Install => "brew install [--cask]", @@ -73,26 +74,6 @@ module Cask Cmd::Zap => "brew upgrade --zap [--cask]", }.freeze - sig { returns(String) } - def self.description - max_command_length = Cmd.commands.map(&:length).max - - command_lines = Cmd.command_classes - .select(&:visible?) - .reject { |command| DEPRECATED_COMMANDS.key?(command) } - .map do |klass| - " - #{"`#{klass.command_name}`".ljust(max_command_length + 2)} #{klass.short_description}\n" - end - - <<~EOS - Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries. - - Commands: - #{command_lines.join} - See also: `man brew` - EOS - end - def self.parser(&block) Homebrew::CLI::Parser.new do if block @@ -101,7 +82,9 @@ module Cask usage_banner <<~EOS `cask` [] [] - #{Cmd.description} + Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries. + + See also: `man brew` EOS end diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index bdfe4a339..0fd56c583 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -100,8 +100,11 @@ module Commands cmds.sort end - def internal_commands_paths - find_commands HOMEBREW_CMD_PATH + def internal_commands_paths(cask: true) + cmds = find_commands HOMEBREW_CMD_PATH + # can be removed when cask commands are removed and no longer odeprecated/odisabled + cmds.delete(HOMEBREW_CMD_PATH/"cask.rb") unless cask + cmds end def internal_developer_commands_paths diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index e32972af7..9beaef713 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -67,7 +67,7 @@ module Homebrew template = (SOURCE_PATH/"brew.1.md.erb").read variables = OpenStruct.new - variables[:commands] = generate_cmd_manpages(Commands.internal_commands_paths) + variables[:commands] = generate_cmd_manpages(Commands.internal_commands_paths(cask: false)) variables[:developer_commands] = generate_cmd_manpages(Commands.internal_developer_commands_paths) variables[:official_external_commands] = generate_cmd_manpages(Commands.official_external_commands_paths(quiet: quiet)) diff --git a/docs/Manpage.md b/docs/Manpage.md index 261f8dee8..280e07ca9 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -65,17 +65,6 @@ Uninstall formulae that were only installed as a dependency of another formula a * `-n`, `--dry-run`: List what would be uninstalled, but do not actually uninstall anything. -### `cask` *`command`* [*`options`*] [*`cask`*] - -Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries. - -Commands: - -- `help` -
Print help for `cask` commands. - -See also: `man brew` - ### `cleanup` [*`options`*] [*`formula`*|*`cask`*] Remove stale lock files and outdated downloads for all formulae and casks, diff --git a/manpages/brew.1 b/manpages/brew.1 index a2becbf84..e7287d93e 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -60,21 +60,6 @@ Uninstall formulae that were only installed as a dependency of another formula a \fB\-n\fR, \fB\-\-dry\-run\fR List what would be uninstalled, but do not actually uninstall anything\. . -.SS "\fBcask\fR \fIcommand\fR [\fIoptions\fR] [\fIcask\fR]" -Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries\. -. -.P -Commands: -. -.TP -\fBhelp\fR -. -.br -Print help for \fBcask\fR commands\. -. -.P -See also: \fBman brew\fR -. .SS "\fBcleanup\fR [\fIoptions\fR] [\fIformula\fR|\fIcask\fR]" Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae\. If arguments are specified, only do this for the given formulae and casks\. Removes all downloads more than 120 days old\. This can be adjusted with \fBHOMEBREW_CLEANUP_MAX_AGE_DAYS\fR\. .