sigma.cli package

class sigma.cli.CommandWithVerbosity(*args, **kwargs)

Bases: click.core.Command

A command that automatically adds the verbosity and traceback arguments, sets up logging prior to invocation, and catches any unhandled exceptions/logs them according to the logging configuration.

invoke(ctx: click.core.Context)

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

class sigma.cli.FuzzyAliasedGroup(name: Optional[str] = None, commands: Optional[Union[Dict[str, click.core.Command], Sequence[click.core.Command]]] = None, **attrs: Any)

Bases: click.core.Group

Click group with fuzzy sub-command matching provided by FuzzyWuzzy.

command(*args, **kwargs)

A shortcut decorator for declaring and attaching a command to the group. This takes the same arguments as command() and immediately registers the created command with this group by calling add_command().

To customize the command class used, set the command_class attribute.

Changed in version 8.1: This decorator can be applied without parentheses.

Changed in version 8.0: Added the command_class attribute.

get_command(ctx, cmd_name)

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

sigma.cli.aliased_group(parent=None, **attrs)

Decorator for creating sub-command groups with fuzzy matching

Parameters
  • parent – the parent command

  • attrs – keyword arguments passed directly to parent.command