aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-29 10:50:25 +0100
committerGravatar jesopo2018-09-29 10:50:25 +0100
commit3dbd997a90fcd032e44e5d7402249921ad041458 (patch)
treeed8157f2ee87a084ea1ef09cce01586bebaa2042
parentStrip trailing newlines from scripts.py returns (diff)
signature
Better .strip()/.split() logic for !help
-rw-r--r--modules/commands.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/commands.py b/modules/commands.py
index d98a7e23..6a37a31e 100644
--- a/modules/commands.py
+++ b/modules/commands.py
@@ -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: