Skip to main content

get_version

Prints the Python, Flask, and Werkzeug versions to the console and then exits the application.

def get_version(
ctx: click.Context,
param: click.Parameter,
value: t.Any
) - > None

Prints the Python, Flask, and Werkzeug versions to the console and then exits the program. This function is typically used as a callback for a command-line option to display version information.

Parameters

NameTypeDescription
ctxclick.ContextThe Click context object, providing access to command-line parameters and utilities. It is used to check for resilient parsing and to exit the program.
paramclick.ParameterThe Click parameter object associated with the version option. This parameter is not directly used in the function's logic.
valuet.AnyThe value of the command-line option. If this value is falsy or if resilient parsing is enabled, the function returns without printing versions or exiting.

Returns

TypeDescription
NoneThis function does not return a value; it exits the program after printing the version information.