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])
|
help = self._get_help(hooks[0])
|
||||||
|
|
||||||
if help:
|
if help:
|
||||||
event["stdout"].write("%s: %s" % (command, " ".join(
|
help = [line.strip() for line in help.split("\n")]
|
||||||
[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:
|
else:
|
||||||
event["stderr"].write("No help available for %s" % command)
|
event["stderr"].write("No help available for %s" % command)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue