Module zut.commands

Functions

add_command(subparsers, handle, *[, name, ...])

Add the given function or module as a command.

add_commands(subparsers, package)

Add all sub modules of the given package as commands.

exec_command(handle[, args, default, ...])

get_description_text(doc)

get_exit_code(code)

get_help_text(doc)

run_command(handle[, args, default, ...])

Run a command. - handle may be: - An ArgumentParser objects: in this case, run_command will take care of calling parse_args on it. - A handle function already parsed before calling this run_command. - A dictionnary: this is intended for running Django subcommands directly from the keywork arguments of the Django command's handle(**option) method. Django-specific options (verbosity, settings, pythonpath, traceback, no_color, force_color and skip_checks) are removed. - context_builder: (args: dict, handle_parameters: list[str]) -> context manager, list of context managers or None.