Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Some issues about virsh -h usage
Version-Release number of selected component (if applicable):
libvirt-0.9.10-14.el6
How reproducible:
Always.
Steps to Reproduce:
Man page:
-h, --help
Ignore all other arguments, and behave as if the help command were
given instead.
Test with the following, found -h does not ignore all other arguments. If it is not, I think the doc should be improved.
# virsh -h -v -V
0.9.10
# virsh -h -V -v
Virsh command line tool of libvirt 0.9.10
See web site at http://libvirt.org/
Compiled with support for:
Hypervisors: QEmu/KVM LXC ESX Test
Networking: Remote Daemon Network Bridging Netcf Nwfilter VirtualPort
Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM
Miscellaneous: SELinux Secrets Debug DTrace Readline
Actual results:
As above
Expected results:
doc should be improved.
Additional info:
Also the following result would be confused:
# virsh -l -h
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
Actually here it think -h is a log file name and output this result; not the -h (help) argument to ignore other options and show the help page, which may be the users' original thought.
For comment 0: this should be easy to fix, since the parser currently treats -h as setting a flag that only gets checked after all other options are parsed, while -v and -V exit immediately without parsing the rest of the options. I'll propose a patch upstream.
For comment 1, the behavior is intentional and will not be changed (since it is provided by the getopt_long() function of glibc); -l always takes an argument, even if that argument looks like another option. This is no different from any other program where options take an argument.
Will be fixed for 6.4 when the rebase picks this up:
commit 46e5d36b8998c53fbea9c589f618ae906103fec7
Author: Eric Blake <eblake>
Date: Mon Apr 30 14:19:11 2012 -0600
virsh: make -h always give help
https://bugzilla.redhat.com/show_bug.cgi?id=817244 mentions that
unlike most other tools, where --help or --version prevent all
further parsing of all later options, virsh was strange in that
--version stopped parsing but --help tried to plow on to the end.
There was no rationale for this original implementation (since
2005!), so I think we can safely conform to common usage patterns.
* tools/virsh.c (main): Drop useless 'help' variable.
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/RHSA-2013-0276.html
Description of problem: Some issues about virsh -h usage Version-Release number of selected component (if applicable): libvirt-0.9.10-14.el6 How reproducible: Always. Steps to Reproduce: Man page: -h, --help Ignore all other arguments, and behave as if the help command were given instead. Test with the following, found -h does not ignore all other arguments. If it is not, I think the doc should be improved. # virsh -h -v -V 0.9.10 # virsh -h -V -v Virsh command line tool of libvirt 0.9.10 See web site at http://libvirt.org/ Compiled with support for: Hypervisors: QEmu/KVM LXC ESX Test Networking: Remote Daemon Network Bridging Netcf Nwfilter VirtualPort Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM Miscellaneous: SELinux Secrets Debug DTrace Readline Actual results: As above Expected results: doc should be improved. Additional info: