Skip to content

Commit

Permalink
Makes args readable
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Sep 13, 2024
1 parent d6e39d6 commit f09b35d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Library/Homebrew/cli/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Parser
}.freeze, T::Hash[Symbol, String])
private_constant :ArgType, :HIDDEN_DESC_PLACEHOLDER, :SYMBOL_TO_USAGE_MAPPING

sig { returns(Args) }
attr_reader :args

sig { returns(Args::OptionsType) }
attr_reader :processed_options

Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/extend/os/linux/parser.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: true # rubocop:todo Sorbet/StrictSigil
# typed: strict
# frozen_string_literal: true

module Homebrew
Expand All @@ -10,13 +10,13 @@ module ParserLinux

sig { void }
def set_default_options
@args["formula?"] = true if @args.respond_to?(:formula?)
args["formula?"] = true if args.respond_to?(:formula?)
end

sig { void }
def validate_options
return unless @args.respond_to?(:cask?)
return unless @args.cask?
return unless args.respond_to?(:cask?)
return unless args.cask?

# NOTE: We don't raise an error here because we don't want
# to print the help page or a stack trace.
Expand Down

0 comments on commit f09b35d

Please sign in to comment.