Project

General

Profile

Actions

Feature #12036

open

nicer word wrapping on long hammer output lines

Added by Bryan Kearney over 8 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Hammer
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1228816
Description of problem:
When you run a hammer command that gives long output, the output isn't that nice:
[root@rhel6sat6 ~]# hammer subscription list --organization-id 1
[Foreman] Username: admin
[Foreman] Password for admin:
------------------------------------------------------------------------|----------|---------|---------|-----------|----------|------------|----------------------------------|-------------------------------------------------------------------------|-----------|---------
NAME | CONTRACT | ACCOUNT | SUPPORT | QUANTITY | CONSUMED | END DATE | ID | PRODUCT | QUANTITY | ATTACHED
------------------------------------------------------------------------|----------|---------|---------|-----------|----------|------------|----------------------------------|-------------------------------------------------------------------------|-----------|---------
Red Hat Enterprise Linux Server, Premium (4 sockets) (Up to 4 guests) | 10610060 | 5535483 | PREMIUM | 1 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0e9ea0117 | Red Hat Enterprise Linux Server, Premium (4 sockets) (Up to 4 guests) | 1 | 0
Red Hat Enterprise Linux Server, Premium (8 sockets) (Unlimited guests) | 10608086 | 5535483 | PREMIUM | 5 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0ee1a01c3 | Red Hat Enterprise Linux Server, Premium (8 sockets) (Unlimited guests) | 5 | 0
Red Hat Satellite | 10608084 | 5535483 | Premium | 1 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0ef6601f5 | Red Hat Satellite | 1 | 0
Red Hat Satellite - Add-Ons for Providers | 10608081 | 5535483 | Layered | 100 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0eb960149 | Red Hat Satellite - Add-Ons for Providers | 100 | 0
Software Collections and Developer Toolset | 10610056 | 5535483 | Layered | 5 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0ecd5018d | Software Collections and Developer Toolset | 5 | 0
Software Collections and Developer Toolset | 10610056 | 5535483 | Layered | 1 | 0 | 2015-12-31 | 8a8d11e94c8ed0b2014c93d0e7fd00e1 | Software Collections and Developer Toolset | 1 | 0
pgproduct | | | | Unlimited | 0 | 2045-04-01 | 8a8d11e94c8ed0b2014c9e6ec7770321 | pgproduct | Unlimited | 0
------------------------------------------------------------------------|----------|---------|---------|-----------|----------|------------|----------------------------------|-------------------------------------------------------------------------|-----------|---------
[root@rhel6sat6 ~]#

Version-Release number of selected component (if applicable):
6.1 beta

How reproducible:
100%

Steps to Reproduce:
1. Run a hammer line like # hammer subscription list --organization-id 1
2.
3.

Actual results:
The output line wraps so that ID and PRODUCT are often on the next line.

Expected results:
Well.... If there is too much text on a line to be displayed, you could either do no line wrapping so that you have to scroll horizontally or maybe you could do line wrapping per column. For example, instead of "Red Hat Enterprise Linux Server, Premium (4 sockets) (Up to 4 guests)" wrapping to the next line, you might have that column have a width of 20 characters and then have the text in the column wrap within those 20 characters.

Another option is to have a blank line after every line of output:
Red Hat Enterprise Linux Server, Premium (4 sockets) (Up to 4 guests)

Red Hat Enterprise Linux Server, Premium (8 sockets) (Unlimited guests)

Red Hat Satellite

...

Additional info:


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesClosed

Actions
Actions #1

Updated by Tomáš Strachota over 7 years ago

Actions #2

Updated by Tomáš Strachota over 6 years ago

  • Target version set to 115
Actions #3

Updated by Oleh Fedorenko about 4 years ago

  • Project changed from Hammer CLI to Katello
  • Category set to Hammer
  • Triaged set to Yes
  • Team Backlog deleted (Marek)

There is already a possibility to limit displayed data within a column (:max_width option for a field).

Changing the project to Katello and suggesting to review List commands and reduce columns count or use :max_width for fields that expect large data to show.

Also, there is a workaround: specify 'base' output adapter.

hammer --output base subscription list --organization-id 1

Actions

Also available in: Atom PDF