mccli.click_utils

class CustomUsageCommand(name: str | None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[[...], Any] | None = None, params: List[Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool = False)

Bases: Command

property usage_text: str
format_usage(ctx, formatter)

Writes the usage line into the formatter.

This is a low-level method called by get_usage().

class SshUsageCommand(name: str | None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[[...], Any] | None = None, params: List[Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool = False)

Bases: CustomUsageCommand

property usage_text
class ScpUsageCommand(name: str | None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[[...], Any] | None = None, params: List[Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool = False)

Bases: CustomUsageCommand

property usage_text
access_token_sources(func)
motley_cue_options(func)
verbosity_options(func)
help_options(func)
basic_options(func)

The basic set of common options to be used by all commands.

It still contains a hidden –dry-run option so that the user can pass it to the parent command as well.

extended_options(func)

Extends the basic common options by adding a –dry-run option to the verbosity group.

additional_options(func)

A group for additional options that are not used by all commands.

warn_if_outdated_wrapper(func)
disable_version_check_option(logger=None, *names, **kwargs)

A decorator that adds a –disable-version-check option to the decorated command.

Name can be configured through *names. Keyword arguments are passed to the underlying click.option decorator.

print_version(ctx: Context, param: Parameter, value: bool) None

Print version and exit context.

validate_verify(ctx, param, value)

First, take over value from parent, if set. Disable warnings when insecure is set. Might seem weird: the flag is called –insecure, but the meaning of the value is verify: - True by default, verify if HTTPS requests are secure, verify certificates - False means do not verify, disable warnings. When the flag is set, verify will be False.

validate_pass_from_parent(ctx, param, value)

If a param’s value is set in the parent command, (via ctx.meta[param]) then take it over to the subcommand Otherwise, use given value and set it in the context to be propagated to subcommands

my_logging_simple_verbosity_option(logger=None, *names, **kwargs)

My version of @click_logging.simple_verbosity_option that takes over the value from the parent command.

A decorator that adds a –verbosity, -v option to the decorated command.

Name can be configured through *names. Keyword arguments are passed to the underlying click.option decorator.

my_debug_option(logger=None, *names, **kwargs)

A decorator that adds a –debug option to the decorated command.

Name can be configured through *names. Keyword arguments are passed to the underlying click.option decorator.

my_help_option(*param_decls: str, **kwargs: Any) Callable[[FC], FC]

My version of @click.help_option that adds –help to the optgroup.

Add a --help option which immediately prints the help page and exits the program.

This is usually unnecessary, as the --help option is added to each command automatically unless add_help_option=False is passed.

Parameters:
  • param_decls – One or more option names. Defaults to the single value "--help".

  • kwargs – Extra arguments are passed to option().

tuple_to_list(ctx, param, value)