swh.core.cli package#

Submodules:

Module contents:

class swh.core.cli.SWHHelpFormatter(indent_increment: int = 2, width: int | None = None, max_width: int | None = None)[source]#

Bases: HelpFormatter

A subclass of click’s HelpFormatter which converts some :ref: to links to the SWH documentation

write_text(text)[source]#

Writes re-indented text into the buffer. This rewraps and preserves paragraphs.

class swh.core.cli.AliasedGroup(name=None, commands=None, **attrs)[source]#

Bases: Group

A simple Group that supports:

  • command aliases

  • notes related to options

It will also ensure the –help option can always be handled by disabling the callback of the group when the tool is called with –help or -h

group_class#

alias of type

get_command(ctx, cmd_name)[source]#

Given a context and a command name, this returns a Command object if it exists or returns None.

add_alias(name, alias)[source]#
format_options(ctx, formatter)[source]#

Writes all the options into the formatter if they exist.

invoke(ctx)[source]#

Given a context, this invokes the attached callback (if it exists) in the right way.

swh.core.cli.clean_exit_on_signal(signal, frame)[source]#

Raise a SystemExit exception to let command-line clients wind themselves down on exit

swh.core.cli.validate_loglevel_params(ctx, param, values)[source]#

Validate the –log-level parameters, with multiple values.

swh.core.cli.validate_options(ctx, param, values)[source]#
swh.core.cli.setup_config(ctx, config_file, options=None)[source]#
swh.core.cli.show_versions(ctx: Context, param: Parameter, value: bool) None[source]#
swh.core.cli.main()[source]#