when available, use command spec for !help usage
This commit is contained in:
parent
0c28d63822
commit
6a3702577f
1 changed files with 8 additions and 5 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue