diff --git a/osc/cmdln.py b/osc/cmdln.py index 3d303b09..f72f1dc5 100644 --- a/osc/cmdln.py +++ b/osc/cmdln.py @@ -788,10 +788,10 @@ class RawCmdln(cmd.Cmd): # practice dictates that command help strings begin with this, but # it isn't at all wanted for the command list. to_strip = "${cmd_name}:" - if doc and doc.startswith(to_strip): + if doc and doc.lstrip().startswith(to_strip): #log.debug("stripping %r from start of %s's help string", # to_strip, cmdname) - doc = doc[len(to_strip):].lstrip() + doc = (doc.lstrip())[len(to_strip):].lstrip() if not getattr(self._get_cmd_handler(cmdname), "hidden", None): linedata.append( (cmdstr, doc) )