Class: QuietQuality::Cli::ArgParser
- Inherits:
-
Object
- Object
- QuietQuality::Cli::ArgParser
- Defined in:
- lib/quiet_quality/cli/arg_parser.rb
Instance Method Summary collapse
- #help_text ⇒ Object
-
#initialize(args) ⇒ ArgParser
constructor
A new instance of ArgParser.
- #parsed_options ⇒ Object
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_text ⇒ Object
21 22 23 |
# File 'lib/quiet_quality/cli/arg_parser.rb', line 21 def help_text @_help_text ||= parser.to_s end |
#parsed_options ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/quiet_quality/cli/arg_parser.rb', line 12 def unless @parsed parser.parse!(@args) @parsed_options.tools = validated_tool_names(@args.dup).map(&:to_sym) @parsed = true end @parsed_options end |