Improve readability

This commit is contained in:
Douglas Eichelberger 2024-03-17 09:29:40 -07:00
parent 4b358fc713
commit 133b9382f0

View File

@ -8,9 +8,9 @@ module Tapioca
module Compilers
class Args < Tapioca::Dsl::Compiler
GLOBAL_OPTIONS = T.let(
Homebrew::CLI::Parser.global_options.map { _1.slice(0, 2) }.flatten
.map { "#{Homebrew::CLI::Parser.option_to_name(_1)}?" }.freeze,
T::Array[String],
Homebrew::CLI::Parser.global_options.map do |short_option, long_option, _|
[short_option, long_option].map { "#{Homebrew::CLI::Parser.option_to_name(_1)}?" }
end.flatten.freeze, T::Array[String]
)
# This is ugly, but we're moving to a new interface that will use a consistent DSL