print_version
Prints the current Typer version and exits the program if the version flag is set and the context is not in resilient parsing mode.
def print_version(
ctx: click.Context,
param: Option,
value: bool
) - > None
Prints the current Typer version and exits the program if the version flag is set.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | click.Context | The Click context object containing state information for the current command execution. |
| param | Option | The specific CLI option object that triggered this callback. |
| value | bool | The boolean flag indicating whether the version option was provided by the user. |
Returns
| Type | Description |
|---|---|
None | Nothing is returned as the function terminates the process with a typer.Exit exception upon printing. |