Bug 1004385 - rhsm-icon bash completions should not end with a comma
rhsm-icon bash completions should not end with a comma
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.5
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Carter Kozak
John Sefler
:
Depends On:
Blocks: rhsm-rhel65
  Show dependency treegraph
 
Reported: 2013-09-04 10:12 EDT by John Sefler
Modified: 2013-11-21 16:28 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Consequence: tab completion displays comma (,) after option. Fix: Remove the comma Result:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 16:28:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2013-09-04 10:12:21 EDT
Description of problem:

[root@jsefler-6 ~]# rhsm-icon -<TAB><TAB>
-c,                   --check-period,       --debug,              -f,                   -h,                   --help-all,           -i,
--check-immediately,  -d,                   --display             --force-icon,         --help,               --help-gtk,       

With the exception of "--display", notice that all of the proposed tab completions above end with a comma.  This should not happen.  The tab completions should be valid options; "-c" is a valid option, "-c," is not a valid option.

Version-Release number of selected component (if applicable):
[root@jsefler-6 ~]# rpm -q subscription-manager bash-completion
subscription-manager-1.9.5-1.el6.x86_64
bash-completion-1.3-7.el6.noarch

Offending file:
/etc/bash_completion.d/rhsm-icon
Comment 1 Carter Kozak 2013-09-12 11:07:37 EDT
commit b93b4fecbff480a443f0611667e0b68ebabb15f3
Author: ckozak <ckozak@redhat.com>
Date:   Wed Sep 4 10:44:55 2013 -0400

    1004385: rhsm icon completion fix
Comment 3 John Sefler 2013-09-13 14:27:27 EDT
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager bash-completion
subscription-manager-1.9.6-1.el6.x86_64
bash-completion-1.3-7.el6.noarch

[root@jsefler-6 ~]# rhsm-icon -h 
Usage:
  rhsm-icon [OPTION...] 

Help Options:
  -h, --help                  Show help options
  --help-all                  Show all help options
  --help-gtk                  Show GTK+ Options

Application Options:
  -c, --check-period          how often to check for validity (in seconds)
  -d, --debug                 show debug messages
  -f, --force-icon=TYPE       force display of the icon (expired, partial or warning)
  -i, --check-immediately     run the first status check right away
  --display=DISPLAY           X display to use

[root@jsefler-6 ~]# rhsm-icon -<TAB><TAB>
-c                   --debug              -h                   -i
--check-immediately  --display            --help               
--check-period       -f                   --help-all           
-d                   --force-icon         --help-gtk       


VERIFIED: tab completion of rhsm-icon properly displays all thirteen options (without comma suffix)
Comment 4 John Sefler 2013-09-15 22:32:04 EDT
Reopening this bug because we should include TAB completion on the gtk options too.

[root@jsefler-6 ~]# rhsm-icon --help-all 
Usage:
  rhsm-icon [OPTION...] 

Help Options:
  -h, --help                  Show help options
  --help-all                  Show all help options
  --help-gtk                  Show GTK+ Options

GTK+ Options
  --class=CLASS               Program class as used by the window manager
  --name=NAME                 Program name as used by the window manager
  --screen=SCREEN             X screen to use
  --gdk-debug=FLAGS           Gdk debugging flags to set
  --gdk-no-debug=FLAGS        Gdk debugging flags to unset
  --sync                      Make X calls synchronous
  --gtk-module=MODULES        Load additional GTK+ modules
  --g-fatal-warnings          Make all warnings fatal
  --gtk-debug=FLAGS           GTK+ debugging flags to set
  --gtk-no-debug=FLAGS        GTK+ debugging flags to unset

Application Options:
  -c, --check-period          how often to check for validity (in seconds)
  -d, --debug                 show debug messages
  -f, --force-icon=TYPE       force display of the icon (expired, partial or warning)
  -i, --check-immediately     run the first status check right away
  --display=DISPLAY           X display to use


As demonstrated in comment 3, tab completion is working for most all of the command options except the gtk options.  Please tab complete these too.


Additional info:  The gtk options differ between RHEL 5 and RHEL 6.  The RHEL 6 gtk options are shown above.  The RHEL5 gtk options are as follows...

[root@jsefler-5 ~]# rhsm-icon --help-gtk
Usage:
  rhsm-icon [OPTION...] 

GTK+ Options
  --class=CLASS               Program class as used by the window manager
  --name=NAME                 Program name as used by the window manager
  --display=DISPLAY           X display to use
  --screen=SCREEN             X screen to use
  --sync                      Make X calls synchronous
  --gtk-module=MODULES        Load additional GTK+ modules
  --g-fatal-warnings          Make all warnings fatal

On RHEL5, options --gdk-debug --gdk-no-debug --gtk-debug --gtk-no-debug are excluded.

On RHEL7, the gtk options appear to be the same as on RHEL6.
Comment 5 Carter Kozak 2013-09-19 14:36:43 EDT
commit 630000bf6239874f7485008d95a1409fde338014
Author: ckozak <ckozak@redhat.com>
Date:   Mon Sep 16 09:52:49 2013 -0400

    1004385: Add missing rhsm-icon debug options
Comment 6 John Sefler 2013-09-24 18:27:14 EDT
(In reply to Carter Kozak from comment #5)
>     1004385: Add missing rhsm-icon debug options

Looks like you misread comment 4

The GTK options that need to be added to the tab completion logic for subscription-manager on RHEL6 and RHEL7 are:
  --class
  --name
  --screen
  --gdk-debug
  --gdk-no-debug
  --sync
  --gtk-module
  --g-fatal-warnings
  --gtk-debug=FLAGS
  --gtk-no-debug=FLAGS

You only added tab completion logic for --gdk-debug --gdk-no-debug --gtk-debug --gtk-no-debug
Comment 4 says that on RHEL5 (FIVE) that subscription-manager's tab completion logic should exclude these debug options.

Moving back to ASSIGNED.
Comment 7 Carter Kozak 2013-09-25 09:42:49 EDT
Removing gtk-debug and gdk-debug options from rhsm-icon.

We will support tab completion of options visible from "rhsm-icon --help" not options from rhsm-icon --help-gtk, however the --help-gtk option will be completed
Comment 8 Carter Kozak 2013-09-25 10:21:25 EDT
commit 1b7422ea192803b39771a7bf38c8c9047680f94d
Author: ckozak <ckozak@redhat.com>
Date:   Wed Sep 25 09:43:23 2013 -0400

    1004385: remove some gtk help options
Comment 9 Bryan Kearney 2013-09-26 14:05:19 EDT
fixed in subscription-manager-1.9.7-1
Comment 10 John Sefler 2013-09-27 12:41:16 EDT
(In reply to Bryan Kearney from comment #9)
> fixed in subscription-manager-1.9.7-1

Nope: comment 8 has not yet been cherry-picked to RHEL6.5 subscription-manager-1.9.7-1.el6
Comment 13 Sharath Dwaral 2013-10-07 19:51:33 EDT
Version:

Tested on stage

# subscription-manager version 
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.9.9-1.el6
python-rhsm: 1.9.6-1.el6

As per Comment 7, rhsm-icon will tab complete without GTK options

# rhsm-icon -
-c                   --check-period       --debug              -f                   -h                   --help-all           -i                   
--check-immediately  -d                   --display            --force-icon         --help               --help-gtk

VERIFIED
Comment 14 errata-xmlrpc 2013-11-21 16:28:31 EST
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-1659.html

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