Class: Rodish::OptionParser

Inherits:
OptionParser
  • Object
show all
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

Instance Method Details

#add_officiousObject

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 }

Raises:



20
21
22
# File 'lib/rodish/option_parser.rb', line 20

def halt(string)
  raise CommandExit, string
end