Change in ovirt-engine-cli[cli_3.5]: cli: Don't break long values

juan.hernandez at redhat.com juan.hernandez at redhat.com
Wed Jul 9 08:33:06 UTC 2014


Juan Hernandez has submitted this change and it was merged.

Change subject: cli: Don't break long values
......................................................................


cli: Don't break long values

Currently when the value of a field is very long, we try to break it so
that it will take several lines. For example:

  [RHEVM shell (connected)]# show something
  id              : ee34f1fb-308d-494f-a084-f58ec5b35b87
  very-long-field : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    xxxxxxx

But the actual result isn't correctlly aligned due to an error in the
way we format the columns. In addition this formatting isn't useful for
users that want to copy and paste the text, as the copied text will
include spaces that the user will have to manually remove. To avoid the
issue alltogheter this patch changes the CLI so that it won't try to
break the lines. The result will be like this:

  [RHEVM shell (connected)]# show something
  id              : ee34f1fb-308d-494f-a084-f58ec5b35b87
  very-long-field : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxx

This patch also changes the default options of the "less" pager so that
it won't break long lines.

Change-Id: I8b8b7d1abcaa40a16c3be9fc26a8591b061cd103
Bug-Url: https://bugzilla.redhat.com/1077806
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 7aec3b2ebf6e8a385442ca56e9c6bd22d3694499)
---
M src/cli/platform/posix/util.py
M src/ovirtcli/format/text.py
2 files changed, 5 insertions(+), 17 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/29737
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b8b7d1abcaa40a16c3be9fc26a8591b061cd103
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: cli_3.5
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list