RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 848095 - Adjust 'subscription-manager --help' layout
Summary: Adjust 'subscription-manager --help' layout
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Sefler
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771481 840993
TreeView+ depends on / blocked
 
Reported: 2012-08-14 15:11 UTC by Matt Reid
Modified: 2013-02-21 08:55 UTC (History)
3 users (show)

Fixed In Version: subscription-manager-1.1.4-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 08:55:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
shows how many descriptions take 2 lines (49.45 KB, image/png)
2012-08-14 15:14 UTC, Matt Reid
no flags Details
longer module/option descriptions are unattractive when wrapped (75.10 KB, image/png)
2012-11-19 14:20 UTC, John Sefler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0350 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-02-20 20:53:35 UTC

Description Matt Reid 2012-08-14 15:11:59 UTC
Description of problem:
Our output and layout combine to look less than ideal on a default sized terminal (which is 80 characters). This would apply if they're in a tty/sshed, or if they just opened a terminal and haven't resized it.

We have 2 commands that are 1 character too long to fit on a single line in the terminal, 2 more that are 2 characters too long, and 1 that is 3. Along with a few that are significantly too long (1 char - list, unsubscribe; 2 - import, orgs; 3 - redeem, 9+ config, identity, register, unregister, clean).

I think the easiest way to clear up a lot of this is to adjust our default indentation of the modules. We indent them all by 8 characters, which doesn't seem to be a default for --help type stuff. Looking at yum, rpm, and a few other commands, most of those are indented 0 - 2 characters.

Yum seems like the best command to emulate, and it doesn't indent modules/commands at all, options have a 2 character indent. Removing the indent would free up another 8 characters for our descriptions, and fix five descriptions that take two lines by being 1 - 3 characters too long.

I also think we can remove the extra newline right after the line where they typed 'subscription-manager --help' and after 'Usage: ...'. A single line of whitespace should be enough.

You can see the output of subscription-manager --help and yum --help here:
pastebin.redhat.com/101904
(should be active for a month)

Comment 1 Matt Reid 2012-08-14 15:14:32 UTC
Created attachment 604328 [details]
shows how many descriptions take 2 lines

Comment 2 Matt Reid 2012-08-14 15:15:57 UTC
URL should be http://pastebin.test.redhat.com/101904.

Missed the test piece...

Comment 4 Bryan Kearney 2012-10-30 19:14:09 UTC
fixed in master at 881157917884a7eb434b9cc3d00eabdcf61645e6

Comment 6 Adrian Likins 2012-11-08 22:47:26 UTC
commit 881157917884a7eb434b9cc3d00eabdcf61645e6
Author: Bryan Kearney <bkearney>
Date:   Tue Oct 30 13:56:58 2012 -0400

    848095: Reduce the indentation on the help text to improve the layout on smaller terminals.

Comment 8 John Sefler 2012-11-19 14:20:42 UTC
Created attachment 647778 [details]
longer module/option descriptions are unattractive when wrapped

[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.1.9-1.el6.x86_64


I think a better fix for this bug is to use the same wrapping logic used to fix bug 864177
https://bugzilla.redhat.com/show_bug.cgi?id=864177#c4

Comment 9 Matt Reid 2012-11-19 15:40:12 UTC
Fix already committed helped clean it up some, but we do still have some strings that are too long regardless.

That's an interesting thought, John, that'd be really nice. BK, would it be super trivial to apply here as well or should I file an RFE for 7.0?

Comment 10 Bryan Kearney 2012-11-19 15:53:15 UTC
lets open up a new RFE for 7.0.

Comment 11 Bryan Kearney 2012-11-19 15:54:15 UTC
Moving back ON_QA based on previous comments.

Comment 12 Matt Reid 2012-11-19 19:17:56 UTC
BZ opened for 7.0 to improve wrapping - https://bugzilla.redhat.com/show_bug.cgi?id=878089

Comment 13 John Sefler 2012-11-19 20:53:21 UTC
Demonstrating original complaint...
[root@rhsm-compat-rhel63 ~]# rpm -q subscription-manager
subscription-manager-0.99.19.4-1.el6_3.x86_64

[root@rhsm-compat-rhel63 ~]# subscription-manager --help | egrep "^\s+\w"
	list           List subscription and product information for this machine
	refresh        Pull the latest subscription data from the server
	register       register the client to RHN
	release        Configure what os release to use
	subscribe      Subscribe the registered machine to a specified product
	unregister     unregister the client from RHN
	unsubscribe    Unsubscribe the machine from all or specific subscriptions
	clean          Remove all local consumer and subscription data without affecting the server
	config         List, set, or remove the configuration parameters in use by this machine.
	environments   Display the environments available for a user
	facts          Work with the current facts for this machine
	identity       Display the identity certificate for this machine or request a new one
	import         Import certificates which were provided outside of the tool
	orgs           Display the orgs against which a user can register a system
	redeem         Attempt to redeem a subscription for a preconfigured machine
	repos          List the repos which this machine is entitled to use
	service-level  Manage service levels for this system.
^^^^^^^^
WASTED SPACE HERE IS CONTRIBUTING TO ALL THE UGLY WRAPPED DESCRIPTIONS ON AN 80 CHAR WIDE stty TERMINAL.


SOLUTION FROM COMMENT 6 REPLACES THE LEADING TAB WITH TWO HARD SPACES:
-                    print("\t%-14s %s" % (name, cmd.shortdesc))
+                    print("  %-14s %s" % (name, cmd.shortdesc))
-                print("\t%-14s %s" % (name, cmd.shortdesc))
+                print("  %-14s %s" % (name, cmd.shortdesc))


Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.1.9-1.el6.x86_64

[root@jsefler-6 ~]# subscription-manager --help | egrep "^\s+\w"
  attach         Attach a specified subscription to the registered system
  list           List subscription and product information for this system
  refresh        Pull the latest subscription data from the server
  register       Register this system to the Customer Portal or another subscription management service
  release        Configure which operating system release to use
  remove         Remove all or specific subscriptions from this system
  unregister     Unregister this system from the Customer Portal or another subscription management service
  clean          Remove all local system and subscription data without affecting the server
  config         List, set, or remove the configuration parameters in use by this system
  environments   Display the environments available for a user
  facts          View or update the detected system information
  identity       Display the identity certificate for this system or request a new one
  import         Import certificates which were provided outside of the tool
  orgs           Display the organizations against which a user can register a system
  redeem         Attempt to redeem a subscription for a preconfigured system
  repos          List the repositories which this system is entitled to use
  service-level  Manage service levels for this system
  subscribe      Deprecated, see attach
  unsubscribe    Deprecated, see remove
  version        Print version information
^^

VERIFIED: We now see two hard spaces instead of a tab, but the original complaint prevails.

Moving this bug to VERIFIED in favor of bug 878089 which will be the ultimate fix.

Comment 15 errata-xmlrpc 2013-02-21 08:55:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0350.html


Note You need to log in before you can comment on or make changes to this bug.