Makes args readable
This commit is contained in:
parent
27e951c408
commit
7cd329c116
@ -24,6 +24,9 @@ module Homebrew
|
|||||||
}.freeze, T::Hash[Symbol, String])
|
}.freeze, T::Hash[Symbol, String])
|
||||||
private_constant :ArgType, :HIDDEN_DESC_PLACEHOLDER, :SYMBOL_TO_USAGE_MAPPING
|
private_constant :ArgType, :HIDDEN_DESC_PLACEHOLDER, :SYMBOL_TO_USAGE_MAPPING
|
||||||
|
|
||||||
|
sig { returns(Args) }
|
||||||
|
attr_reader :args
|
||||||
|
|
||||||
sig { returns(Args::OptionsType) }
|
sig { returns(Args::OptionsType) }
|
||||||
attr_reader :processed_options
|
attr_reader :processed_options
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
@ -10,13 +10,13 @@ module Homebrew
|
|||||||
|
|
||||||
sig { void }
|
sig { void }
|
||||||
def set_default_options
|
def set_default_options
|
||||||
@args["formula?"] = true if @args.respond_to?(:formula?)
|
args["formula?"] = true if args.respond_to?(:formula?)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { void }
|
sig { void }
|
||||||
def validate_options
|
def validate_options
|
||||||
return unless @args.respond_to?(:cask?)
|
return unless args.respond_to?(:cask?)
|
||||||
return unless @args.cask?
|
return unless args.cask?
|
||||||
|
|
||||||
# NOTE: We don't raise an error here because we don't want
|
# NOTE: We don't raise an error here because we don't want
|
||||||
# to print the help page or a stack trace.
|
# to print the help page or a stack trace.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user