cvs: pear /Console_Getargs Getargs.php

From: Date: Sun, 24 Oct 2004 20:02:04 +0000
Subject: cvs: pear /Console_Getargs Getargs.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-25183@lists.php.net to get a copy of this message
mansion Sun Oct 24 16:02:04 2004 EDT Modified files: /pear/Console_Getargs Getargs.php Log: Allow the use of long options aliases. This fixes one problem with unit test method: testAlias() http://cvs.php.net/diff.php/pear/Console_Getargs/Getargs.php?r1=1.8&r2=1.9&ty=u Index: pear/Console_Getargs/Getargs.php diff -u pear/Console_Getargs/Getargs.php:1.8 pear/Console_Getargs/Getargs.php:1.9 --- pear/Console_Getargs/Getargs.php:1.8 Fri Oct 22 11:47:05 2004 +++ pear/Console_Getargs/Getargs.php Sun Oct 24 16:02:02 2004 @@ -16,7 +16,7 @@ // | Author: Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Getargs.php,v 1.8 2004/10/22 15:47:05 scottmattocks Exp $ +// $Id: Getargs.php,v 1.9 2004/10/24 20:02:02 mansion Exp $ require_once 'PEAR.php'; @@ -699,9 +699,13 @@ // Found a match in the short option names. $cmp = $opt; $long = $this->_shortLong[$opt]; - } else if ($isLong === true && isset($this->_config[$opt])) { + } elseif ($isLong === true && isset($this->_config[$opt])) { // Found a match in the long option names. $long = $cmp = $opt; + } elseif ($isLong === true && isset($this->_aliasLong[$opt])) { + // Found a match in the long option names. + $long = $this->_aliasLong[$opt]; + $cmp = $opt; } if ($arg{$i} === '=') { // End of the option name when '=' is found. @@ -1016,4 +1020,4 @@ * c-basic-offset: 4 * End: */ -?> +?> \ No newline at end of file

« previous php.pear.cvs (#25183) next »