From 6a3702577fa69d98b6484f8300e581b088bc8d44 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 25 Jan 2020 23:15:02 +0000 Subject: [PATCH] when available, use command spec for !help usage --- src/core_modules/help.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core_modules/help.py b/src/core_modules/help.py index 58659d9d..3ebe4f66 100644 --- a/src/core_modules/help.py +++ b/src/core_modules/help.py @@ -6,11 +6,14 @@ class Module(ModuleManager.BaseModule): return hook.get_kwarg("help", None) or hook.docstring.description def _get_usage(self, hook, command, command_prefix=""): command = "%s%s" % (command_prefix, command) - usage = hook.get_kwarg("usage", None) - if usage: - usages = [usage] - else: - usages = hook.docstring.var_items.get("usage", None) + + spec = hook.get_kwargs("spec") + usages_kwarg = hook.get_kwargs("usage") + + if spec: + usages = [utils.parse.argument_spec_human(s) for s in spec] + elif usage: + usages = usages_kwarg if usages: return " | ".join(