Package wsatools :: Module CLI :: Class CLI :: Class Option
[hide private]

Class Option

source code


A program option definition.

Instance Methods [hide private]
 
__init__(self, char, longName, desc, argument=None, default=None, isValOK=<function <lambda> at 0x290ede8>)
Define this option.
source code
 
__cmp__(self, other)
Compare on option short name (for sorting etc.).
source code
str
__str__(self)
Returns: Option's long name.
source code
str
getHelpLine(self)
Returns: Option details for the --help mode.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, char, longName, desc, argument=None, default=None, isValOK=<function <lambda> at 0x290ede8>)
(Constructor)

source code 

Define this option.

Parameters:
  • char (str) - The single character short name for the option, will be preceded by '-' as command-line option.
  • longName (str) - The long name of the option, single word, will be preceded by '--' as command-line option.
  • desc (str) - Full description of option for the --help mode.
  • argument (str) - If option takes an argument, supply a hint here e.g. 'NAME', for the --help mode.
  • default (str) - The default value for the option's argument.
  • isValOK (function) - A function to test if the supplied value is formatted correctly, of the form "bool f(x)".
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Returns: str
Option's long name.
Overrides: object.__str__

getHelpLine(self)

source code 
Returns: str
Option details for the --help mode.