Class: SimpleCovMcp::OptionParserBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov_mcp/option_parser_builder.rb

Constant Summary collapse

HORIZONTAL_RULE =
'-' * 79
SUBCOMMANDS =
%w[list summary raw uncovered detailed totals validate version].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ OptionParserBuilder

Returns a new instance of OptionParserBuilder.



13
14
15
# File 'lib/simplecov_mcp/option_parser_builder.rb', line 13

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/simplecov_mcp/option_parser_builder.rb', line 11

def config
  @config
end

Instance Method Details

#build_option_parserObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/simplecov_mcp/option_parser_builder.rb', line 17

def build_option_parser
  require 'optparse'
  OptionParser.new do |parser|
    configure_banner(parser)
    define_subcommands_help(parser)
    define_options(parser)
    define_examples(parser)
    add_help_handler(parser)
  end
end