4Suite API Documentation: Ft.Lib.CommandLine.Options

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 |  |  |  | Globals: 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)

  ### Members

  multiple = False
class ExclusiveOptions(BaseOption)

  ### Methods

  __init__(self, choices)
  apply_options(self, options)
    Overrides: apply_options from class BaseOption
  displayLength(self)
    Overrides: displayLength from class BaseOption
  gen_command_line(self)
    Overrides: gen_command_line from class BaseOption
  getForGetOpt(self, short2long, takes_arg)
    Overrides: getForGetOpt from class BaseOption
  getName(self)
    Overrides: getName from class BaseOption
  isApplied(self)
    Overrides: isApplied from class BaseOption
  validate(self)
    Overrides: validate from class BaseOption

  ### Methods inherited from class BaseOption

  __repr__, __str__, gen_description

  ### Members inherited from class BaseOption

  multiple
class Option(BaseOption)

  ### Methods

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

  ### Methods inherited from class BaseOption

  __repr__, __str__, gen_description

  ### Members inherited from class BaseOption

  multiple
class Options(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)
    Overrides: __init__ from class list
  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 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 object

  __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

  ### Members

  __dict__ = <attribute '__dict__' of 'Options' objects>
  __weakref__ = <attribute '__weakref__' of 'Options' objects>

  ### Members inherited from class object

  __class__
class TypedOption(Option)

  ### Methods

  __init__(self, shortName, longName, description, allowed, subOptions=None)
    Overrides: __init__ from class Option
  apply_options(self, options)
    Overrides: apply_options from class Option
  gen_command_line(self)
    Overrides: gen_command_line from class Option
  validate(self)
    Overrides: validate from class Option

  ### Methods inherited from class Option

  displayLength, getForGetOpt, getName, isApplied

  ### Methods inherited from class BaseOption

  __repr__, __str__, gen_description

  ### Members inherited from class BaseOption

  multiple

## Globals

CONSOLE_WIDTH = 206