mirror of
https://github.com/tornadoweb/tornado.git
synced 2025-02-26 20:45:53 +00:00
fix bug when no help text given for option - wrap returns empty list
This commit is contained in:
parent
e4e85da3a6
commit
dd3ff7f89b
@ -184,7 +184,7 @@ def print_help(file=sys.stdout):
|
||||
if option.default is not None and option.default != '':
|
||||
description += " (default %s)" % option.default
|
||||
lines = textwrap.wrap(description, 79 - 35)
|
||||
if len(prefix) > 30:
|
||||
if len(prefix) > 30 or len(lines) == 0:
|
||||
lines.insert(0, '')
|
||||
print >> file, " --%-30s %s" % (prefix, lines[0])
|
||||
for line in lines[1:]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user