Class: Ego::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/ego/options.rb

Overview

Parse command-line options and set defaults.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Options

Returns a new instance of Options.

Parameters:

  • argv (Array)

    command-line arguments



17
18
19
20
21
22
23
# File 'lib/ego/options.rb', line 17

def initialize(argv)
  @mode = :interpret
  @plugins = true
  @verbose = false
  parse(argv)
  @query = argv.join(' ')
end

Instance Attribute Details

#modeObject (readonly)

Returns the value of attribute mode.



8
9
10
# File 'lib/ego/options.rb', line 8

def mode
  @mode
end

#pluginsObject (readonly)

Returns the value of attribute plugins.



8
9
10
# File 'lib/ego/options.rb', line 8

def plugins
  @plugins
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/ego/options.rb', line 8

def query
  @query
end

#robot_nameObject (readonly)

Returns the value of attribute robot_name.



8
9
10
# File 'lib/ego/options.rb', line 8

def robot_name
  @robot_name
end

#usageObject (readonly)

Returns the value of attribute usage.



8
9
10
# File 'lib/ego/options.rb', line 8

def usage
  @usage
end

#usage_errorObject (readonly)

Returns the value of attribute usage_error.



8
9
10
# File 'lib/ego/options.rb', line 8

def usage_error
  @usage_error
end

#verboseObject (readonly)

Returns the value of attribute verbose.



8
9
10
# File 'lib/ego/options.rb', line 8

def verbose
  @verbose
end