4Suite™ API Documentation

# ► Module Ft.Lib.CommandLine.Options

Classes that support advanced option processing for command-line scripts
Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: BaseOption, ExclusiveOptions, Option, Options, TypedOption |  |  |  | Fields: CONSOLE_WIDTH

## Classes

class BaseOption
An option that is available to be used in an invocation of a command-line script, plus related functions.

### Methods

__repr__ = __str__(self)
__str__(self)
apply_options(self, options)
displayLength(self)
gen_command_line(self)
gen_description(self)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

### Fields

multiple = False

class ExclusiveOptions(BaseOption)

### Methods

__init__(self, choices)
apply_options(self, options)
displayLength(self)
gen_command_line(self)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

### Methods inherited from class BaseOption

__repr__, __str__, gen_description

### Fields

class Option(BaseOption)

### Methods

__init__(self, shortName, longName, description, subOptions=None, multiple=False)
apply_options(self, options)
displayLength(self)
gen_command_line(self)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

### Methods inherited from class BaseOption

__repr__, __str__, gen_description

### Fields

class Options(__builtin__.list)
A set of options that are available to be used in an invocation of a command-line script, plus related functions.

### Methods

__init__(self, options=None)
findMaxOption(self, level=0)
generate_help(self, level=1, max_opt=0)
Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.

### Methods inherited from class __builtin__.list

__add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

### Methods inherited from class __builtin__.object

__delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

### Fields

__dict__ = <attribute '__dict__' of 'Options' objects>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Options' objects>
list of weak references to the object (if defined)

### Fields

class TypedOption(Option)

### Methods

__init__(self, shortName, longName, description, allowed, subOptions=None)
apply_options(self, options)
gen_command_line(self)
validate(self)

### Methods inherited from class Option

displayLength, getForGetOpt, getName, isApplied

### Methods inherited from class BaseOption

__repr__, __str__, gen_description

### Fields

CONSOLE_WIDTH = 80