Class: TChart::CommandLineParser

Inherits:
Object
  • Object
show all
Defined in:
lib/tchart/process/command_line_parser.rb

Overview

Responsible for parsing command line options and arguments.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(argv) ⇒ Object

> [ CommandLineArgs, [] ] or [ nil, [ String, … ] ]



8
9
10
# File 'lib/tchart/process/command_line_parser.rb', line 8

def self.parse(argv) # => [ CommandLineArgs, [] ] or [ nil, [ String, ... ] ]
  CommandLineParser.new.parse(argv)
end

Instance Method Details

#parse(argv) ⇒ Object

> [ CommandLineArgs, [] ] or [ nil, [ String, … ] ]



12
13
14
15
16
17
# File 'lib/tchart/process/command_line_parser.rb', line 12

def parse(argv) # => [ CommandLineArgs, [] ] or [ nil, [ String, ... ] ]
  parse_options(argv)
  [ parse_args(argv), [] ]
rescue TChartError => e
  [ nil, [ e.message ] ]
end