swh.core.cli package#


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


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

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.

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.