manpages: fix error under Ruby 3

This commit is contained in:
Bo Anderson 2023-11-05 00:54:59 +00:00
parent e002907b14
commit fa5ca71749
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -145,8 +145,8 @@ module Homebrew
if long.present?
next if Homebrew::CLI::Parser.global_options.include?([short, long, desc])
next if Homebrew::CLI::Parser.global_cask_options.any? do |_, option, description:, **|
[long, "#{long}="].include?(option) && description == desc
next if Homebrew::CLI::Parser.global_cask_options.any? do |_, option, kwargs|
[long, "#{long}="].include?(option) && kwargs.fetch(:description) == desc
end
end
@ -184,8 +184,8 @@ module Homebrew
def self.global_cask_options_manpage
lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` " \
"subcommands with the `--cask` switch.\n"]
lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
generate_option_doc(nil, long.chomp("="), description)
lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, kwargs|
generate_option_doc(nil, long.chomp("="), kwargs.fetch(:description))
end
lines.join("\n")
end