Module: Metro::Parameters::CommandLineArgsParser

Extended by:
CommandLineArgsParser
Included in:
CommandLineArgsParser
Defined in:
lib/metro/parameters/command_line_args_parser.rb

Overview

The CommandLineArgsParser converts the argument list passed in from the command-line and generates an Metro::Parameters::Options object.

Instance Method Summary collapse

Instance Method Details

#parse(*parameters) ⇒ Object

Given the array of parameters usually from the Command-Line ARGV and convert that information into various parameters



15
16
17
18
19
20
21
22
23
# File 'lib/metro/parameters/command_line_args_parser.rb', line 15

def parse(*parameters)
  parameters = parameters.flatten.compact
  options = { execution_parameters: parameters.dup }

  command_flags = extract_command_flags!(parameters)
  filename = extract_game_file!(parameters)

  Options.new options.merge(filename: filename).merge(command_flags)
end