diff options
| author | 2018-09-29 10:50:25 +0100 | |
|---|---|---|
| committer | 2018-09-29 10:50:25 +0100 | |
| commit | 3dbd997a90fcd032e44e5d7402249921ad041458 (patch) | |
| tree | ed8157f2ee87a084ea1ef09cce01586bebaa2042 | |
| parent | Strip trailing newlines from scripts.py returns (diff) | |
| signature | ||
Better .strip()/.split() logic for !help
| -rw-r--r-- | modules/commands.py | 8 |
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: |
