Skip to content

Commit

Permalink
Maybe improve help stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 25, 2020
1 parent e3aba7f commit ba4fc26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maubot/handlers/command.py
Expand Up @@ -147,6 +147,8 @@ async def __parse_args__(self, evt: MaubotMessageEvent, call_args: Dict[str, Any
@property
def __mb_full_help__(self) -> str:
usage = self.__mb_usage_without_subcommands__ + "\n\n"
if not self.__mb_require_subcommand__:
usage += f"* {self.__mb_prefix__} {self.__mb_usage_args__} - {self.__mb_help__}\n"
usage += "\n".join(cmd.__mb_usage_inline__ for cmd in self.__mb_subcommands__)
return usage

Expand Down Expand Up @@ -188,7 +190,7 @@ def __mb_subcommands_list__(self) -> str:
def __mb_usage_without_subcommands__(self) -> str:
if not self.__mb_arg_fallthrough__:
return (f"**Usage:** {self.__mb_prefix__} {self.__mb_usage_args__}"
f" _OR_ {self.__mb_usage_subcommand__}")
f" _OR_ {self.__mb_prefix__} {self.__mb_usage_subcommand__}")
return f"**Usage:** {self.__mb_prefix__} {self.__mb_usage_args__}"

@property
Expand Down

0 comments on commit ba4fc26

Please sign in to comment.