lib.{App,Cmd}: Pass parent= by name to Cmd* constructors #115

Merged
Jan Lindemann merged 1 commit from jan/feature/20260920-lib-app-cmd-pass-parent-by-name-to-cmd-constructors into master 2026-09-20 12:01:58 +02:00 AGit

2026-09-20

lib.{App,Cmd}: Pass parent= by name to Cmd* constructors
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m40s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m45s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m12s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m37s
CI / Packaging test (push) Successful in 0s
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-20 11:51:25 +02:00