Fix showing usage when a user doesn't provide enough args to a command
This commit is contained in:
parent
02e76444d1
commit
09b6f52d8e
1 changed files with 5 additions and 4 deletions
|
@ -147,12 +147,13 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
min_args = hook.kwargs.get("min_args")
|
||||
if min_args and len(args_split) < min_args:
|
||||
if "usage" in hook.kwargs:
|
||||
usage = self._get_usage(hook)
|
||||
if usage:
|
||||
stderr.write("Not enough arguments, usage: %s %s" % (
|
||||
command, hook.kwargs["usage"])).send()
|
||||
command, usage)).send()
|
||||
else:
|
||||
stderr.write("Not enough arguments (minimum: %d)" % min_args
|
||||
).send()
|
||||
stderr.write("Not enough arguments (minimum: %d)" %
|
||||
min_args).send()
|
||||
else:
|
||||
args = " ".join(args_split)
|
||||
server = event["server"]
|
||||
|
|
Loading…
Reference in a new issue