Better .strip()/.split() logic for !help
This commit is contained in:
parent
c12e8220ac
commit
3dbd997a90
1 changed files with 6 additions and 2 deletions
|
@ -168,8 +168,12 @@ class Module(ModuleManager.BaseModule):
|
|||
help = self._get_help(hooks[0])
|
||||
|
||||
if help:
|
||||
event["stdout"].write("%s: %s" % (command, " ".join(
|
||||
[line.strip() for line in help.split("\n")])))
|
||||
help = [line.strip() for line in help.split("\n")]
|
||||
help = [line.strip() for line in help]
|
||||
help = filter(None, help)
|
||||
help = " ".join(help)
|
||||
|
||||
event["stdout"].write("%s: %s" % (command, help))
|
||||
else:
|
||||
event["stderr"].write("No help available for %s" % command)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue