4Suite API Documentation

Module Ft.Lib.CommandLine.Command

Superclass for a command that can be invoked by a command-line script.

Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
Classes:
Fields:

Classes

class Command
Superclass for a command that can be invoked by a command-line script. Most commands won't need to subclass this.

A Command object encapsulates, for a particular command, a description,
usage example, a set of valid options & arguments, methods for
validating the actual options and arguments entered, a function for
command invocation, and an association with subordinate Commands.

A tree of commands can be created by associating each Command instance
with its subordinates. Typically, only the leaves of the tree will have
functionality; the branches just provide ways of grouping the leaves
and will not need to encapsulate the invocation functions themselves.

Methods

__init__(self, name, description, example, verbose_description, function=None, options=None, arguments=None, subCommands=None, authenticate=0, heading=None, fileName=None)
flatten_command_tree(self, level, previousName='')
run_command(self, auth)
validate_arguments(self, args)
validate_options(self, options)

Fields