From cfa831c46355498c7bb612b9d25b72f83c13f838 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 25 Oct 2020 19:30:37 +0200 Subject: [PATCH] Improve usage when base command has no arguments --- maubot/handlers/command.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maubot/handlers/command.py b/maubot/handlers/command.py index 33deb01..4d0058f 100644 --- a/maubot/handlers/command.py +++ b/maubot/handlers/command.py @@ -189,6 +189,8 @@ class CommandHandler: @property def __mb_usage_without_subcommands__(self) -> str: if not self.__mb_arg_fallthrough__: + if not self.__mb_arguments__: + return f"**Usage:** {self.__mb_prefix__} [subcommand] [...]" return (f"**Usage:** {self.__mb_prefix__} {self.__mb_usage_args__}" f" _OR_ {self.__mb_prefix__} {self.__mb_usage_subcommand__}") return f"**Usage:** {self.__mb_prefix__} {self.__mb_usage_args__}"