Class: Rodish::OptionParser
- Inherits:
-
OptionParser
- Object
- OptionParser
- Rodish::OptionParser
- Defined in:
- lib/rodish/option_parser.rb
Overview
Rodish::OptionPaser is a subclass of Ruby’s standard OptionParser (from the optparse library).
Instance Method Summary collapse
-
#add_officious ⇒ Object
Don’t add officious, which includes options that call exit.
-
#halt(string) ⇒ Object
Halt processing with a CommandExit using the given string.
Instance Method Details
#add_officious ⇒ Object
Don’t add officious, which includes options that call exit. With Rodish, there are no secret options, only options you define.
12 13 |
# File 'lib/rodish/option_parser.rb', line 12 def add_officious end |
#halt(string) ⇒ Object
Halt processing with a CommandExit using the given string. This can be used to implement early exits, by calling this method in a block:
on("--version", "show program version") { halt VERSION }
20 21 22 |
# File 'lib/rodish/option_parser.rb', line 20 def halt(string) raise CommandExit, string end |