svn: /pear/pear-core/trunk/scripts/ pearcmd.php

From: Date: Sat, 27 Mar 2010 15:13:06 +0000
Subject: svn: /pear/pear-core/trunk/scripts/ pearcmd.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9335@lists.php.net to get a copy of this message
dufuz Sat, 27 Mar 2010 15:13:06 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296932 Log: * Fix Bug #17220 command pear help outputs to stderr instead of stdout [dufuz] Bug: http://pear.php.net/bugs/17220 (unknown) Changed paths: U pear/pear-core/trunk/scripts/pearcmd.php Modified: pear/pear-core/trunk/scripts/pearcmd.php =================================================================== --- pear/pear-core/trunk/scripts/pearcmd.php 2010-03-27 15:06:22 UTC (rev 296931) +++ pear/pear-core/trunk/scripts/pearcmd.php 2010-03-27 15:13:06 UTC (rev 296932) @@ -318,18 +318,17 @@ function usage($error = null, $helpsubject = null) { global $progname, $all_commands; - $stderr = fopen('php://stderr', 'w'); + $stdout = fopen('php://stdout', 'w'); if (PEAR::isError($error)) { - fputs($stderr, $error->getMessage() . "\n"); + fputs($stdout, $error->getMessage() . "\n"); } elseif ($error !== null) { - fputs($stderr, "$error\n"); + fputs($stdout, "$error\n"); } if ($helpsubject != null) { $put = cmdHelp($helpsubject); } else { - $put = - "Commands:\n"; + $put = "Commands:\n"; $maxlen = max(array_map("strlen", $all_commands)); $formatstr = "%-{$maxlen}s %s\n"; ksort($all_commands); @@ -342,8 +341,8 @@ "Type \"$progname help shortcuts\" to list all command shortcuts.\n". "Type \"$progname help <command>\" to get the help for the specified command."; } - fputs($stderr, "$put\n"); - fclose($stderr); + fputs($stdout, "$put\n"); + fclose($stdout); exit(1); }

« previous php.pear.core (#9335) next »