diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index a51b6f0890..76c14bcf6c 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 bdfe4a3398..0fd56c5838 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 e32972af79..9beaef7139 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 261f8dee81..280e07ca95 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 a2becbf847..e7287d93ed 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\. .