Add documentation for OptionsType

This commit is contained in:
Douglas Eichelberger 2024-08-19 09:47:16 -07:00
parent 3943ff1406
commit 4bbad3c995

View File

@ -8,7 +8,13 @@ module Homebrew
class Args < OpenStruct
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
OptionsType = T.type_alias { T::Array[[String, T.nilable(String), T.nilable(String), String, T::Boolean]] }
# Represents a processed option. The array elements are:
# 0: short option name (e.g. "-d")
# 1: long option name (e.g. "--debug")
# 2: ???
# 3: option description (e.g. "Print debugging information")
# 4: whether the option is hidden)
OptionsType = T.type_alias { T::Array[[String, T.nilable(String), NilClass, String, T::Boolean]] }
# rubocop:enable Style/MutableConstant
sig { returns(T::Array[String]) }