cmds.CmdPkg: Rename pkg -> packages #33

Merged
Jan Lindemann merged 2 commits from jan/feature/20260625-cmds-cmdpkg-rename-pkg-packages into master 2026-06-25 10:44:41 +02:00 AGit

lib.Cmd.AbstractCmd.aliases: Add property

Add a property aliases to AbstractCmd in prepeparation for commands to bear multiple names / abbreviations / aliases.

The App.add_cmds_to_parser() function uses parse_known_args() to determine which subcommand was invoked, then conditionally registers nested subcommands. The lookup dictionary (scs) contains only canonical names, not aliases, so add them too, otherwise using the alias instead of the canonical name causes the lookup to fail and nested subcommands to never be registered.

Fix: Register each alias in scs pointing to the same SubCommand object, and deduplicate with id(sc) when iterating in all=True mode to avoid infinite recursion on help output.

cmds.CmdPkg: Rename pkg -> packages

Relabel the toplevel command CmdPkg from "pkg" to "packages", because it rolls off the tounge much more nicely. Keep "pkg" as an alias for compatibilty.

#### lib.Cmd.AbstractCmd.aliases: Add property Add a property aliases to AbstractCmd in prepeparation for commands to bear multiple names / abbreviations / aliases. The App.add_cmds_to_parser() function uses parse_known_args() to determine which subcommand was invoked, then conditionally registers nested subcommands. The lookup dictionary (scs) contains only canonical names, not aliases, so add them too, otherwise using the alias instead of the canonical name causes the lookup to fail and nested subcommands to never be registered. Fix: Register each alias in scs pointing to the same SubCommand object, and deduplicate with id(sc) when iterating in all=True mode to avoid infinite recursion on help output. #### cmds.CmdPkg: Rename pkg -> packages Relabel the toplevel command CmdPkg from "pkg" to "packages", because it rolls off the tounge much more nicely. Keep "pkg" as an alias for compatibilty.

Add a property aliases to AbstractCmd in prepeparation for commands to bear multiple names / abbreviations / aliases.

The App.add_cmds_to_parser() function uses parse_known_args() to determine which subcommand was invoked, then conditionally registers nested subcommands. The lookup dictionary (scs) contains only canonical names, not aliases, so add them too, otherwise using the alias instead of the canonical name causes the lookup to fail and nested subcommands to never be registered.

Fix: Register each alias in scs pointing to the same SubCommand object, and deduplicate with id(sc) when iterating in all=True mode to avoid infinite recursion on help output.

Signed-off-by: Jan Lindemann <jan@janware.com>
cmds.CmdPkg: Rename pkg -> packages
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 2m19s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m30s
CI / Packaging test (pull_request) Failing after 0s
5607588c88

Relabel the toplevel command CmdPkg from "pkg" to "packages", because it rolls off the tounge much more nicely. Keep "pkg" as an alias for compatibilty.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-06-25 09:37:01 +02:00
Jan Lindemann force-pushed jan/feature/20260625-cmds-cmdpkg-rename-pkg-packages from 5607588c88
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 2m19s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m30s
CI / Packaging test (pull_request) Failing after 0s
to a4bc6f2a7f
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m35s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m57s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m11s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m39s
CI / Packaging test (push) Successful in 0s
2026-06-25 10:37:04 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janware/jw-pkg!33
No description provided.