Each instance has an options hash that‘s populated by parse.
Adds general options like -h and —quiet. Usually don‘t override.
Override to add your options to the parser:
def add_options!(opt) opt.on('-v', '--verbose') { |value| options[:verbose] = value } end
Override with your own usage banner.
Convenient access to class default options.
Merge together our instance options. In increasing precedence:
default_options (class default options) options (instance options) runtime_options (provided as argument) mandatory_options (class mandatory options)
Convenient access to class mandatory options.
Parse arguments into the options hash. Classes may customize parsing behavior by overriding these methods:
#banner Usage: ./script/generate [options] #add_options! Options: some options.. #add_general_options! General Options: general options..
Raise a usage error. Override usage_message to provide a blurb after the option parser summary.