1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 05:08:42 +02:00

Merge pull request #329 from andrewshadura/master

Allow whitespace before ${cmd_name}.
This commit is contained in:
Daniel Mach
2022-03-15 09:45:24 +01:00
committed by GitHub

View File

@@ -791,10 +791,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) )