Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.13

Bug #18238 Wrong return code from "pear help"
Submitted: 2011-02-04 15:27 UTC
From: timj Assigned: till
Status: Closed Package: PEAR (version 1.9.1)
PHP Version: 5.3.5 OS:
Roadmaps: (Not assigned)    

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 15 - 8 = ?

 [2011-02-04 15:27 UTC] timj (Tim Jackson)
Description: ------------ Reported in Fedora at : "If you execute the command "pear help" and then you check the return code, you will get 1, but it should be 0 as success." Reproducible on current PEAR 1.9.1 Test script: --------------- pear help >/dev/null;echo $? Expected result: ---------------- 0 Actual result: -------------- 1


 [2011-02-23 21:11 UTC] till (Till Klampaeckel)
This also happens with -s and -o switches. I guess it's a general problem.
 [2011-02-23 22:02 UTC] till (Till Klampaeckel)
Just a summary from our brief discussion on IRC: scripts/pearcmd.php only handles the return code on some occasions. As far as I can tell the error handling used needs to be made context aware and also aware of options passed to pear. Right now the installer uses Pear::raiseError() everywhere. The error handler registered is PHP_Frontend_CLI::displayFatalError(). If someone wants to take a crack at it, this is probably the right place.
 [2011-02-23 22:03 UTC] till (Till Klampaeckel)
Added patch help.
 [2011-02-23 22:04 UTC] till (Till Klampaeckel)
The attached patch corrects the exit status were possible in scripts/pearcmd.php. It's not the final solution to all other status code related issues.
 [2011-02-27 20:00 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Status: Open +Status: Closed -Assigned To: +Assigned To: till
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Till, can you create a new ticket with those other issues and copy some of the text from here? Similar issues but not the same.