Re: patch to PEAR core for Console_Getopt 1.1
| From: | Greg Beaver | Date: | Sat, 06 Dec 2003 23:34:30 +0000 |
| Subject: | Re: patch to PEAR core for Console_Getopt 1.1 | ||
| References: | 1 2 | Groups: | php.pear.dev php.pear.general |
| Request: | Send a blank email to pear-dev+get-24222@lists.php.net to get a copy of this message | ||
Note, you must also patch System.php if you wish to do anything other than "pear list" :)
function _parseArgs($argv, $short_options, $long_options = null)
{
if (!is_array($argv) && $argv !== null) {
- $argv = preg_split('/\s+/', ': '.$argv);
+ $argv = preg_split('/\s+/', $argv);
}
return Console_Getopt::getopt($argv, $short_options);
}
Greg
Klaus Guenther wrote:
This indeed solves the problem. Klaus ----- Original Message ----- From: "Greg Beaver" <greg@chiaraquartet.net> To: <pear-dev@lists.php.net> Sent: Saturday, December 06, 2003 10:33 PM Subject: [PEAR-DEV] patch to PEAR core for Console_Getopt 1.1Hello, This patch will fix PEAR if you have Console_Getopt 1.1 installed. Greg---------------------------------------------------------------------------- ----Index: pear/scripts/pearcmd.php =================================================================== RCS file: /repository/php-src/pear/scripts/pearcmd.php,v retrieving revision 1.3 diff -u -r1.3 pearcmd.php --- pear/scripts/pearcmd.php 30 Jun 2003 10:43:57 -0000 1.3 +++ pear/scripts/pearcmd.php 6 Dec 2003 21:30:59 -0000 @@ -48,6 +48,7 @@ $argv = Console_Getopt::readPHPArgv(); $progname = basename($argv[0]); +array_shift($argv); $options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:vV"); if (PEAR::isError($options)) {$short_args, $long_args))) {usage($options);@@ -155,6 +156,7 @@$short_args = $long_args = null; PEAR_Command::getGetoptArgs($command, $short_args, $long_args); + array_shift($options[1]); if (PEAR::isError($tmp = Console_Getopt::getopt($options[1],---------------------------------------------------------------------------- ----break; }-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php