enable no_args_is_help for all typers subclassing AliasGroup

This includes the root typer

patch bump
This commit is contained in:
2025-04-21 20:19:21 +01:00
parent d945a6fa40
commit 023fdf708b
4 changed files with 9 additions and 3 deletions

View File

@@ -10,6 +10,11 @@ class AliasGroup(typer.core.TyperGroup):
_CMD_SPLIT_P = re.compile(r' ?[,|] ?')
def __init__(self, *args, **kwargs):
"""Initialize the AliasGroup."""
super().__init__(*args, **kwargs)
self.no_args_is_help = True
def get_command(self, ctx, cmd_name):
"""Get a command by name."""
cmd_name = self._group_cmd_name(cmd_name)