cmds.CmdPkg: Rename pkg -> packages #33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260625-cmds-cmdpkg-rename-pkg-packages"
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.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.
5607588c88a4bc6f2a7f