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

4Suite™ API Documentation

# ► Module Ft.Lib.CommandLine.CommandLineApp

Base class for a command-line application, which is a type of Command

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

Classes: CommandLineApp |  |  |  | Globals: CONSOLE_WIDTH

## Classes

class CommandLineApp(Ft.Lib.CommandLine.Command.Command)

  ### Methods

  __init__(self)
    Overrides: __init__ from class Command
  gen_command_tree(self)
    Generate the command tree (a show all commands look)
  gen_usage(self, command=None)
    Generate usage info. This includes description, command line, options, and subcommands or arguments.
  get_help_doc_info(self)
  main(...)
    classmethod(function) -> method

        Convert a function to be a class method.

        A class method receives the class as implicit first argument,
        just like an instance method receives the instance.
        To declare a class method, use this idiom:

          class C:
              def f(cls, arg1, arg2, ...): ...
              f = classmethod(f)

        It can be called either on the class (e.g. C.f()) or on an instance
        (e.g. C().f()).  The instance is ignored except for its class.
        If a class method is called for a derived class, the derived class
        object is passed as the implied first argument.

        Class methods are different than C++ or Java static methods.
        If you want those, see the staticmethod builtin.

  parse_command_line(self)
    Parse the command line.
  run_commands(self, script_name=None, script_args=None)
    Parse the command line and attempt to run the command. Typically overridden in the subclasses.
  validate_options(self, options)
    Overrides: validate_options from class Command

  ### Methods inherited from class Ft.Lib.CommandLine.Command.Command

  break_parent_relationship, build_parent_relationship, flatten_command_tree, run, validate_arguments

  ### Members

  arguments = None
  commands = None
  description = None
  example = None
  global_options = [[--help], [--version]]
  name = None
  options = None
  project_name = None
  project_url = None
  project_version = None
  summary = None

## Globals

CONSOLE_WIDTH = 236