Class: QuietQuality::Cli::ArgParser

Inherits:
Object
  • Object
show all
Defined in:
lib/quiet_quality/cli/arg_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ArgParser

Returns a new instance of ArgParser.



6
7
8
9
10
# File 'lib/quiet_quality/cli/arg_parser.rb', line 6

def initialize(args)
  @args = args
  @parsed_options = Config::ParsedOptions.new
  @parsed = false
end

Instance Method Details

#help_textObject



21
22
23
# File 'lib/quiet_quality/cli/arg_parser.rb', line 21

def help_text
  @_help_text ||= parser.to_s
end

#parsed_optionsObject



12
13
14
15
16
17
18
19
# File 'lib/quiet_quality/cli/arg_parser.rb', line 12

def parsed_options
  unless @parsed
    parser.parse!(@args)
    @parsed_options.tools = validated_tool_names(@args.dup).map(&:to_sym)
    @parsed = true
  end
  @parsed_options
end