ArgType

An instance of ArgType defines that characteristics of a single command line option. All parameters to __init__() are available as public variables.

Methods

__init__(self, name, shortOptions, longOptions, parm, valid, mult, help, helpCmd, parmHelp)

   def __init__(self, name, shortOptions, longOptions = [], parm = 0,
                valid = None, mult = 0, help = "", helpCmd = 0,
                parmHelp = 'parm'
                ):

Constructs ArgType. Parameters:

name

Name of the option.

shortOptions

A string containing the single character command line options.

longOptions

A list of strings containing the long (full word) command line options.

parm

If this is true, the argument accepts a parameter.

valid

If used, should be passed a function which accepts the value of the argument and returns true if the argument is valid (falls within the constraints defined by the parameter). Only appropriate in conjunction with parm

mult

If this is true, the argument may be used more than once on the command line and its value will be returned as a list of all of the values that have been defined for it.

help

If set, this contains a help message that will be printed out along with the option when help is displayed using ComLine.help()

helpCmd

If this is true, the use of this option automatically triggers the ComLine.help() function.

parmHelp

This is the string that will be printed in the option's help message in to describe the parameter for the option. For example, if a value of "file-name" is used for a "-c" option, the option help will look like this:

                -c <file-name>
                   Does something with the given file.