lib.{App,Cmd}: Pass parent= by name to Cmd* constructors #115
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260920-lib-app-cmd-pass-parent-by-name-to-cmd-constructors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
lib.{App,Cmd}: Pass parent= by name to Cmd* constructors
The framework instantiates command classes in two places: the top-level commands in App and the lazily materialized subcommands in Cmd.add_subcommands(). Both pass the parent parameter positionally.
Change that to passing parent by keyword at both call sites. Every command class names its first init() parameter parent, so the keyword form binds the same slot for all of them regardless of parameter order, and it allows a command class to declare parent as keyword-only.