Skip to content

v2.6.0

Compare
Choose a tag to compare
@BrianPugh BrianPugh released this 10 Apr 23:33
09320d1

Features

This release adds two new fields: App.name_transform and Parameter.name_transform. The function's responsibility is to convert python identifiers to their CLI counterparts and has signature:

def name_transform(s: str) -> str:
    ...

These name transforms can be set at a global level for your app:

app = App(
    name_transform=lambda name: name,  # don't modify the name at all. This applies to command names.
    default_parameter=Parameter(name_transform=lambda name: name),  # This applies to parameter names.
)

They can also be set in individual subapps (subapps inherit name_transform from their parent), or in individual Annotated[...., Parameter(name_transform=my_custom_transform)] definitions.

Full Changelog: v2.5.1...v2.6.0