Class: OptSimple::Argument

Inherits:
Option show all
Defined in:
lib/opt_simple.rb

Overview

A mandatory parameter, with one or more argument following it. ‘switches’ can be a String or an Array of Strings, and specifies the switches expected on the CL. ‘help’ provides a description of the parameter, and ‘metavar’ will be used in the usage statement. and an optional block can do parameter validation/transformation. If no block is given, then the strings specified (after the leading ‘-’s removed) will be used as keys in the Result and the values set to the arg following the switch the args array.

Instance Attribute Summary

Attributes inherited from Parameter

#block, #metavar, #param_options, #switches

Instance Method Summary collapse

Methods inherited from Option

#accumulate_opt, #initialize, #switch_len, #switch_str

Methods inherited from Parameter

#error, #help_str, #initialize, #names, #set_opt, #switch_len, #switch_str

Constructor Details

This class inherits a constructor from OptSimple::Option

Instance Method Details

#mandatory?Boolean

returns true in an Argument

Returns:

  • (Boolean)


481
# File 'lib/opt_simple.rb', line 481

def mandatory?; true; end