Skip to main content

get_version

Retrieves and prints the version information for Python, Flask, and Werkzeug to the console before exiting the application.

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

Prints the current versions of Python, Flask, and Werkzeug to the console and exits the program. This function is typically used as a callback for a Click command-line option to provide environment diagnostic information.

Parameters​

NameTypeDescription
ctxclick.ContextThe Click context object used to check for resilient parsing and to control output coloring.
paramclick.ParameterThe Click parameter object associated with the version flag.
valuet.AnyThe value of the parameter; if falsy, the function returns early without printing.

Returns​

TypeDescription
NoneNothing; the function terminates the process via ctx.exit() after printing version information.