Class Getopt::Long
In: lib/getopt/long.rb
Parent: Object

The Getopt::Long class encapsulates longhanded parameter parsing options

Methods

getopts  

Classes and Modules

Class Getopt::Long::Error

Constants

VERSION = '1.4.1'   The version of the getopt library

Public Class methods

Takes an array of switches. Each array consists of up to three elements that indicate the name and type of switch. Returns a hash containing each switch name, minus the ’-’, as a key. The value for each key depends on the type of switch and/or the value provided by the user.

The long switch must be provided. The short switch defaults to the first letter of the short switch. The default type is BOOLEAN.

Example:

 opts = Getopt::Long.getopts(
    ['--debug'                   ],
    ['--verbose', '-v'           ],
    ['--level',   '-l', INCREMENT]
 )

See the README file for more information.

[Validate]