Class: MultipleMan::Options
- Inherits:
-
OptionParser
- Object
- OptionParser
- MultipleMan::Options
- Defined in:
- lib/multiple_man/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Options
constructor
A new instance of Options.
- #set_opts ⇒ Object
Constructor Details
#initialize(*args) ⇒ Options
Returns a new instance of Options.
13 14 15 16 |
# File 'lib/multiple_man/cli.rb', line 13 def initialize(*args) @options = { mode: :general, environment_path: 'config/environment' } super end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/multiple_man/cli.rb', line 11 def @options end |
Class Method Details
.parse!(args) ⇒ Object
5 6 7 8 9 |
# File 'lib/multiple_man/cli.rb', line 5 def self.parse!(args) parser = new('Multiple Man') parser.set_opts.parse!(args) parser. end |
Instance Method Details
#set_opts ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/multiple_man/cli.rb', line 18 def set_opts on('--seed', 'listen to the seeding queue') do [:mode] = :seed end on('-e', '--environment-path PATH', 'Set the path to load the web framework (default: config/environment)') do |value| [:environment_path] = value end end |