Commands Module

Command usage / help text formatters

author:

Doug Skrypa

class cli_command_parser.formatting.commands.CommandHelpFormatter(command: CommandType, params: CommandParameters)[source]

Bases: object

maybe_add_groups(groups: Iterable[ParamGroup])[source]
maybe_add_positionals(params: Iterable[BasePositional])[source]
maybe_add_option(param: Parameter | None)[source]
maybe_add_options(params: Iterable[BaseOption])[source]
format_usage(delim: str = ' ', sub_cmd_choice: OptStr = None, allow_sys_argv: Bool = True, cont_indent: int = 4) str[source]
format_help(allow_sys_argv: Bool = True) str[source]
format_rst(fix_name: Bool = True, fix_name_func: NameFunc = None, init_level: int = 1, allow_sys_argv: Bool = False) str[source]

Generate the RST content for the Command associated with this formatter and all of its subcommands

cli_command_parser.formatting.commands.get_formatter(command: CommandAny) CommandHelpFormatter[source]

Get the CommandHelpFormatter for the given Command

cli_command_parser.formatting.commands.get_usage_sub_cmds(command: CommandCls)[source]