MWCommand#

class lsst.daf.butler.cli.utils.MWCommand(*args: Any, **kwargs: Any)#

Bases: Command

Command subclass that stores a copy of the args list for use by the command.

Parameters#

*argstyping.Any

Arguments for click.Command.

**kwargstyping.Any

Keyword arguments for click.Command.

Attributes Summary

epilog

Override the epilog attribute to add extra_epilog (if defined by a subclass) to the end of any epilog provided by a subcommand.

extra_epilog

name

the name the command thinks it has.

Methods Summary

parse_args(ctx, args)

Given a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary.

Attributes Documentation

epilog#

Override the epilog attribute to add extra_epilog (if defined by a subclass) to the end of any epilog provided by a subcommand.

extra_epilog: str | None = None#
name = 'butler'#

the name the command thinks it has. Upon registering a command on a Group the group will default the command name with this information. You should instead use the Context's info_name attribute.

Methods Documentation

parse_args(ctx: Context, args: Any) list[str]#

Given a context and a list of arguments this creates the parser and parses the arguments, then modifies the context as necessary. This is automatically invoked by make_context().

This function overrides click.Command.parse_args.

The call to _capture_args in this override stores the arguments (option names, option value, and argument values) that were used by the caller on the command line in the context object. These stored arugments can be used by the command function, e.g. to process options in the order they appeared on the command line (pipetask uses this feature to create pipeline actions in an order from different options).

Parameters#

ctxclick.core.Context

The current Context.

argslist [str]

The list of arguments from the command line, split at spaces but not at separators (like “=”).