1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 09:36:21 +01:00

Allow whitespace before ${cmd_name}.

This commit is contained in:
Andrew Shadura 2017-09-02 13:30:37 +02:00
parent b07ba53ad0
commit ca8fe4273a
No known key found for this signature in database
GPG Key ID: 41671BB34A849381

View File

@ -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) )