showhelp: move tw.fullwidth out of the loop

This commit is contained in:
Daniel Hahler 2019-04-05 15:13:35 +02:00
parent e04936fc29
commit e20b39d928
1 changed files with 2 additions and 1 deletions

View File

@ -151,13 +151,14 @@ def showhelp(config):
) )
tw.line() tw.line()
columns = tw.fullwidth # costly call
for name in config._parser._ininames: for name in config._parser._ininames:
help, type, default = config._parser._inidict[name] help, type, default = config._parser._inidict[name]
if type is None: if type is None:
type = "string" type = "string"
spec = "%s (%s)" % (name, type) spec = "%s (%s)" % (name, type)
line = " %-24s %s" % (spec, help) line = " %-24s %s" % (spec, help)
tw.line(line[: tw.fullwidth]) tw.line(line[:columns])
tw.line() tw.line()
tw.line("environment variables:") tw.line("environment variables:")