Skip to main content

install_callback

Installs shell completion for the CLI, prints a confirmation message to the terminal, and terminates the process with a successful exit code.

def install_callback(
ctx: click.Context,
param: click.Parameter,
value: Any
) - > Any

Installs shell completion for the CLI and exits the program. This function is intended to be used as a Click parameter callback to handle the installation process when a specific flag is triggered.

Parameters​

NameTypeDescription
ctxclick.ContextThe current Click context object used to check for resilient parsing mode.
paramclick.ParameterThe Click parameter object that triggered this callback.
valueAnyThe value passed to the parameter, which can be a string specifying a target shell or a boolean to trigger default installation.

Returns​

TypeDescription
AnyThe original value if the function returns early due to resilient parsing; otherwise, the process exits before returning.