Skip to main content

get_click_param

Converts a parameter metadata object into a corresponding Click Argument or Option along with its associated type converter. It handles type inspection for unions, lists, and tuples to determine the appropriate Click parameter configuration and validation logic.

def get_click_param(
param: ParamMeta
) - > tuple[click.Argument | click.Option, Any]

Converts a Typer parameter metadata object into a Click-compatible Argument or Option along with its associated type converter. This function handles type inspection for lists, tuples, and optional types to determine the appropriate Click parameter configuration and CLI flag naming.

Parameters

NameTypeDescription
paramParamMetaThe metadata object containing the parameter's name, type annotation, and default value information used to derive the Click configuration.

Returns

TypeDescription
`tuple[click.Argumentclick.Option, Any]`