mafw.scripts.click_groups
Reusable Click group classes for MAFw command-line interfaces.
This module centralizes the command abbreviation behavior used by the
mafw executable and the development tools so nested command groups can
inherit the same resolution policy without repeating the cls=...
configuration.
Added in version 2.2.
Classes
|
Click group that resolves unique command prefixes. |
|
Click group with abbreviation and MAFw-specific exit handling. |
- class mafw.scripts.click_groups.AbbreviateGroup(name: str | None = None, commands: MutableMapping[str, Command] | Sequence[Command] | None = None, invoke_without_command: bool = False, no_args_is_help: bool | None = None, subcommand_metavar: str | None = None, chain: bool = False, result_callback: Callable[[...], Any] | None = None, **kwargs: Any)[source]
Bases:
GroupClick group that resolves unique command prefixes.
- group_class
alias of
AbbreviateGroup
- class mafw.scripts.click_groups.MAFwGroup(name: str | None = None, commands: MutableMapping[str, Command] | Sequence[Command] | None = None, invoke_without_command: bool = False, no_args_is_help: bool | None = None, subcommand_metavar: str | None = None, chain: bool = False, result_callback: Callable[[...], Any] | None = None, **kwargs: Any)[source]
Bases:
AbbreviateGroupClick group with abbreviation and MAFw-specific exit handling.
- group_class
alias of
AbbreviateGroup
- _detect_command_name(args: list[str]) str | None[source]
Return the first subcommand token while skipping root option values.