MWOption#

class lsst.daf.butler.cli.utils.MWOption(param_decls: Sequence[str] | None = None, show_default: bool | str | None = None, prompt: bool | str = False, confirmation_prompt: bool | str = False, prompt_required: bool = True, hide_input: bool = False, is_flag: bool | None = None, flag_value: Any = Sentinel.UNSET, multiple: bool = False, count: bool = False, allow_from_autoenv: bool = True, type: ParamType | Any | None = None, help: str | None = None, hidden: bool = False, show_choices: bool = True, show_envvar: bool = False, deprecated: bool | str = False, **attrs: Any)#

Bases: Option

Overrides click.Option with desired behaviors.

Methods Summary

make_metavar([ctx])

Make the metavar for the help menu.

Methods Documentation

make_metavar(ctx: Context | None = None) str#

Make the metavar for the help menu.

Parameters#

ctxclick.Context or None

Context from the command.

Notes#

Overrides click.Option.make_metavar. Adds a space and an ellipsis after the metavar name if the option accepts multiple inputs, otherwise defers to the base implementation.

By default click does not add an ellipsis when multiple is True and nargs is 1. And when nargs does not equal 1 click adds an ellipsis without a space between the metavar and the ellipsis, but we prefer a space between.

Does not get called for some option types (e.g. flag) so metavar transformation that must apply to all types should be applied in get_help_record.