MWCommand#
- class lsst.daf.butler.cli.utils.MWCommand(*args: Any, **kwargs: Any)#
Bases:
CommandCommand subclass that stores a copy of the args list for use by the command.
Parameters#
Attributes Summary
Override the epilog attribute to add extra_epilog (if defined by a subclass) to the end of any epilog provided by a subcommand.
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
Groupthe group will default the command name with this information. You should instead use theContext'sinfo_nameattribute.
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_argsin 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#
- ctx
click.core.Context The current Context.
- args
list[str] The list of arguments from the command line, split at spaces but not at separators (like “=”).
- ctx