🐛 修复只输入主命令时不发送帮助提示的bug

This commit is contained in:
2023-11-15 14:34:27 +08:00
parent f9f39618a1
commit 34a654b5df

View File

@@ -90,7 +90,7 @@ def add_default_handlers(matcher: type[AlconnaMatcher]) -> None:
@matcher.handle()
async def _(matcher: Matcher, matches: AlcMatches):
if matches.head_matched and matches.options != {}:
if matches.head_matched and matches.options != {} or matches.main_args == {}:
await matcher.finish(
(f'{matches.error_info!r}\n' if matches.error_info is not None else '')
+ f'输入"{matches.header_result} --help"查看帮助'