Commit ec39d63c authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cli: Fix bug when not using headers

Commit 9fe72672

 added code to not write spaces at the end of each line.
Unfortunately it didn't work properly when not printing headers—there would
still be spaces.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 03956d39
......@@ -1575,14 +1575,17 @@ def GenerateTable(headers, fields, separator, data,
for idx, name in enumerate(fields):
hdr = headers[name]
if separator is None:
if idx == len(fields) - 1 and not numfields.Matches(name):
mlens[idx] = 0
mlens[idx] = max(mlens[idx], len(hdr))
mlens[idx] = max(mlens[idx], len(hdr))
result.append(format % tuple(args))
if separator is None:
assert len(mlens) == len(fields)
if fields and not numfields.Matches(fields[-1]):
mlens[-1] = 0
for line in data:
args = []
if line is None:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment