From 9fe7267203f57b0a22309971eb30208ea1d7114c Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 13 Jan 2010 12:34:54 +0100
Subject: [PATCH] cli.GenerateTable: Don't write EOL spaces

With this change, there won't be unnecessary space characters
at the end of lines.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cli.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/cli.py b/lib/cli.py
index bbdb62998..8a41e2d69 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -1575,7 +1575,10 @@ def GenerateTable(headers, fields, separator, data,
     for idx, name in enumerate(fields):
       hdr = headers[name]
       if separator is None:
-        mlens[idx] = max(mlens[idx], len(hdr))
+        if idx == len(fields) - 1 and not numfields.Matches(name):
+          mlens[idx] = 0
+        else:
+          mlens[idx] = max(mlens[idx], len(hdr))
         args.append(mlens[idx])
       args.append(hdr)
     result.append(format % tuple(args))
-- 
GitLab