In `cmd.Cmd.do_help` call `inspect.cleandoc()`,
to clean indentation and remove leading/trailing empty
lines from a dosctring before printing.
functions respectively.
"""
-import string, sys
+import inspect, string, sys
__all__ = ["Cmd"]
except AttributeError:
try:
doc=getattr(self, 'do_' + arg).__doc__
+ doc = inspect.cleandoc(doc)
if doc:
self.stdout.write("%s\n"%str(doc))
return
--- /dev/null
+:meth:`cmd.Cmd.do_help` now cleans docstrings with :func:`inspect.cleandoc`\r
+before writing them. Patch by Filip Łapkiewicz.