v2.6.0
Features
- Add
App.name_transform
by @BrianPugh in #147 - Add
Parameter.name_transform
by @BrianPugh in #149
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