libbe.ui.command_line

A command line interface to Bugs Everywhere.

class libbe.ui.command_line.BE(*args, **kwargs)

Class for parsing the command line arguments for be. This class does not contain a useful _run() method. Call this module’s main() function instead.

>>> ui = libbe.command.UserInterface()
>>> ui.io.stdout = sys.stdout
>>> be = BE(ui=ui)
>>> ui.io.setup_command(be)
>>> p = CmdOptionParser(be)
>>> p.exit_after_callback = False
>>> try:
...     options,args = p.parse_args(['--help']) 
... except CallbackExit:
...     pass
usage: be [options] [COMMAND [command-options] [COMMAND-ARGS ...]]

Options:
  -h, --help         Print a help message.

  --complete         Print a list of possible completions.

  --version          Print version string.
...
>>> try:
...     options,args = p.parse_args(['--complete']) 
... except CallbackExit:
...     print '  got callback'
--help
--version
...
subscribe
tag
target
  got callback

Methods

cleanup()
complete([argument, fragment])
full_version(*args)
help(*args)
run([options, args])
usage()
version(*args)
full_version(*args)
name = 'be'
usage()
version(*args)
exception libbe.ui.command_line.CallbackExit
class libbe.ui.command_line.CmdOptionParser(command)

Methods

add_option(Option) add_option(opt_str, ...)
add_option_group(*args, **kwargs)
add_options(option_list)
callback(option, opt, value, parser)
check_values(values : Values, ...) -> (values : Values, args : [string])
complete([argument, fragment])
destroy() Declare that you are done with this OptionParser. This cleans up
disable_interspersed_args() Set parsing to stop on the first non-option.
enable_interspersed_args() Set parsing to not stop on the first non-option, allowing interspersing switches with command arguments.
error(msg : string) Print a usage message incorporating ‘msg’ to stderr and exit.
exit([status, msg])
expand_prog_name(s)
format_description(formatter)
format_epilog(formatter)
format_help([formatter])
format_option_help([formatter])
get_default_values()
get_description()
get_option(opt_str)
get_option_group(opt_str)
get_prog_name()
get_usage()
get_version()
has_option(opt_str)
parse_args([args, values])
print_help(file : file = stdout) Print an extended help message, listing all options and any
print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to ‘file’ (default stdout).
print_version(file : file = stdout) Print the version message for this program (self.version) to ‘file’ (default stdout).
process_raw_argument(argument, value)
remove_option(opt_str)
set_conflict_handler(handler)
set_default(dest, value)
set_defaults(**kwargs)
set_description(description)
set_process_default_values(process)
set_usage(usage)
callback(option, opt, value, parser)
complete(argument=None, fragment=None)
parse_args(args=None, values=None)
process_raw_argument(argument, value)
class libbe.ui.command_line.CommandLine(*args, **kwargs)

Methods

cleanup()
help()
run(command[, options, args])
setup_command(command)
help()
libbe.ui.command_line.dispatch(ui, command, args)
libbe.ui.command_line.main()

Previous topic

libbe.ui

This Page