Skip to content

Commit

Permalink
Merge pull request #329 from andrewshadura/master
Browse files Browse the repository at this point in the history
Allow whitespace before ${cmd_name}.
  • Loading branch information
dmach committed Mar 15, 2022
2 parents f4626dd + ca8fe42 commit 473b0d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osc/cmdln.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,10 @@ def _help_get_command_list(self):
# 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) )

Expand Down

0 comments on commit 473b0d4

Please sign in to comment.