Bug 598771

Summary: guestfish 'help' command should indicate error in exit status with an unknown command
Product: Red Hat Enterprise Linux 6 Reporter: Jinxin Zheng <jzheng>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.1CC: hbrock, mbooth, mjenner, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libguestfs-1.2.7-1.11.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 597145 Environment:
Last Closed: 2010-11-10 21:02:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 597145, 598772    
Bug Blocks:    

Description Jinxin Zheng 2010-06-02 02:14:25 UTC
+++ This bug was initially created as a clone of Bug #597145 +++

Description of problem:
Issueing the 'help' command in guestfish with an unknown command name exits 
with a 0 exit code.

Version-Release number of selected component (if applicable):
guestfish 1.3.17

How reproducible:
Always

Steps to Reproduce:
1. guestfish help foo
2. echo $?
3.
  
Actual results:
the exit status of guestfish is 0

Expected results:
supposed to be some other than 0 to indicate an error.

Additional info:
I wanted to use help to test the availability of some new commands in a script, 
finding that it's impossible to determine only from the exit status of guestfish.
Therefore I must test the stderr in order to work the result out.

--- Additional comment from rjones on 2010-06-01 11:31:26 EDT ---

Patch posted upstream:
https://www.redhat.com/archives/libguestfs/2010-June/msg00013.html

Please clone this bug if you want this in RHEL 5/6.  It's a relatively
simple change to backport.

Comment 2 Richard W.M. Jones 2010-06-03 08:56:54 UTC
Scratch build for RHEL 6 here:
https://brewweb.devel.redhat.com/taskinfo?taskID=2489956

I have tested this build on RHEL 6 and it works.

Patch posted and ACKed here:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2010-June/msg00061.html

Comment 3 RHEL Program Management 2010-06-07 16:01:48 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 8 Jinxin Zheng 2010-07-16 05:09:42 UTC
# guestfish help launch >/dev/null 
# echo $?
0

# guestfish help help >/dev/null 
# echo $?
0

# guestfish help blahblah >/dev/null 
blahblah: command not known, use -h to list all commands
# echo $?
1

guestfish help with non-existent command returns with the exit status 1, so move this bug to VERIFIED.

Comment 9 releng-rhel@redhat.com 2010-11-10 21:02:57 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.