Merge pull request #5055 from blueyed/showhelp-lazy-fullwidth

showhelp: move tw.fullwidth out of the loop
This commit is contained in:
Bruno Oliveira 2019-04-05 12:11:47 -03:00 committed by GitHub
commit 87ce586d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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