cvs: pear /Console_Getargs Getargs.php
| From: | Bertrand Mansion | Date: | Sun, 24 Oct 2004 20:37:57 +0000 |
| Subject: | cvs: pear /Console_Getargs Getargs.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25184@lists.php.net to get a copy of this message | ||
mansion Sun Oct 24 16:37:57 2004 EDT
Modified files:
/pear/Console_Getargs Getargs.php
Log:
Fix a bug in checking for max numbers of values introduced in 1.4
http://cvs.php.net/diff.php/pear/Console_Getargs/Getargs.php?r1=1.9&r2=1.10&ty=u
Index: pear/Console_Getargs/Getargs.php
diff -u pear/Console_Getargs/Getargs.php:1.9 pear/Console_Getargs/Getargs.php:1.10
--- pear/Console_Getargs/Getargs.php:1.9 Sun Oct 24 16:02:02 2004
+++ pear/Console_Getargs/Getargs.php Sun Oct 24 16:37:57 2004
@@ -16,7 +16,7 @@
// | Author: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Getargs.php,v 1.9 2004/10/24 20:02:02 mansion Exp $
+// $Id: Getargs.php,v 1.10 2004/10/24 20:37:57 mansion Exp $
require_once 'PEAR.php';
@@ -867,7 +867,7 @@
return PEAR::raiseError('Argument '.$optname.' expects at least
'.$min.(($min > 1) ? ' values' : ' value'),
CONSOLE_GETARGS_ERROR_USER, PEAR_ERROR_RETURN,
null, 'Console_Getargs_Options::setValue()');
- } else if ($max !== -1 && $added >= $max) {
+ } elseif ($max !== -1 && $added > $max) {
// Too many arguments for this option.
// Try to add the extra options to parameters.
if (isset($this->_config[CONSOLE_GETARGS_PARAMS]) && $optname !=
CONSOLE_GETARGS_PARAMS) {