bsb.cli.commands package#

Module contents#

Contains all of the logic required to create commands. It should always suffice to import just this module for a user to create their own commands.

Inherit from BaseCommand for regular CLI style commands, or from BsbCommand if you want more freedom in what exactly constitutes a command to the BSB.

class bsb.cli.commands.BaseCommand[source]#

Bases: BsbCommand

add_locals(context)[source]#
add_parser_arguments(parser)[source]#
add_parser_options(parser, context, locals, level)[source]#
add_subparsers(parser, context, commands, locals, level)[source]#
add_to_parser(parent, context, locals, level)[source]#
execute_handler(namespace, dryrun=False)[source]#
get_options()[source]#
class bsb.cli.commands.BaseParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]#

Bases: ArgumentParser

Inherits from argparse.ArgumentParser and overloads the error method so that when an error occurs, instead of exiting and exception is thrown.

error(message)[source]#

Raise message, instead of exiting.

Parameters:

message (str) – Error message

class bsb.cli.commands.BsbCommand[source]#

Bases: object

add_to_parser()[source]#
handler(context)[source]#
class bsb.cli.commands.RootCommand[source]#

Bases: BaseCommand

get_options()[source]#
get_parser(context)[source]#
handler(context)[source]#
name = 'bsb'#
bsb.cli.commands.load_root_command()[source]#