when available, use command spec for !help usage

This commit is contained in:
jesopo 2020-01-25 23:15:02 +00:00
parent 0c28d63822
commit 6a3702577f

View file

@ -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(