Package logilab :: Package common :: Module clcommands
[frames] | no frames]

Module clcommands

source code

Helper functions to support command line tools providing more than
one command.

e.g called as "tool command [options] args..." where <options> and <args> are
command'specific

:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses

Classes
  BadCommandUsage
Raised when an unknown command is used or when a command is not correctly used.
  Command
Base class for command line commands.
  ListCommandsCommand
list available commands, useful for bash completion.
Functions
 
cmd_run(cmdname, *args) source code
 
main_run(args, doc='Type "%prog <command> --help" for more information about a sp...)
command line tool
source code
 
main_usage(status=0, __doc__='Type "%prog <command> --help" for more information about a sp..., copyright='Copyright (c) 2004-2009 LOGILAB S.A. (Paris, FRANCE), all rig...)
display usage for the main program (i.e.
source code
 
pop_arg(args_list, expected_size_after=0, msg='Missing argument')
helper function to get and check command line arguments
source code
 
register_commands(commands)
register existing commands
source code
Variables
  DEFAULT_COPYRIGHT = 'Copyright (c) 2004-2009 LOGILAB S.A. (Par...
  DEFAULT_DOC = 'Type "%prog <command> --help" for more informat...
  __package__ = 'logilab.common'
Function Details

main_usage(status=0, __doc__='Type "%prog <command> --help" for more information about a sp..., copyright='Copyright (c) 2004-2009 LOGILAB S.A. (Paris, FRANCE), all rig...)

source code 
display usage for the main program (i.e. when no command supplied)
and exit


Variables Details

DEFAULT_COPYRIGHT

Value:
'''Copyright (c) 2004-2009 LOGILAB S.A. (Paris, FRANCE), all rights re\
served.
http://www.logilab.fr/ -- mailto:contact@logilab.fr'''

DEFAULT_DOC

Value:
'''Type "%prog <command> --help" for more information about a specific
command. Available commands are :
'''