Class: Loxxy::CLIParser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/loxxy/cli_parser.rb

Overview

A command-line option parser for the Loxxy interpreter. It is a specialisation of the OptionParser class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prog_name, ver) ⇒ CLIParser

Constructor.



13
14
15
16
17
18
19
20
21
# File 'lib/loxxy/cli_parser.rb', line 13

def initialize(prog_name, ver)
  super()
  reset(prog_name, ver)

  heading
  separator 'Options:'
  separator ''
  add_tail_options
end

Instance Attribute Details

#parsed_optionsHash{Symbol=>String, Array} (readonly)

Returns:

  • (Hash{Symbol=>String, Array})


10
11
12
# File 'lib/loxxy/cli_parser.rb', line 10

def parsed_options
  @parsed_options
end

Instance Method Details

#parse!(args) ⇒ Object



23
24
25
26
# File 'lib/loxxy/cli_parser.rb', line 23

def parse!(args)
  super
  parsed_options
end