fix bug when no help text given for option - wrap returns empty list

This commit is contained in:
Mike Koss 2012-04-27 04:16:28 -07:00
parent e4e85da3a6
commit dd3ff7f89b
1 changed files with 1 additions and 1 deletions

View File

@ -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:]: