PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Console » Console_Getopt » Bug #1831

Does not support = sign in argument value on longoptions

Details

Submitted2004-07-09 11:37 UTC
Fromleening at dauphin-mm dot nl
Assignedandrei
StatusClosed
PackageConsole_Getopt
PHP Version4.3.4
OSLinux
Roadmaps(Not assigned)

Comments

[2004-07-09 11:37 UTC] leening at dauphin-mm dot nl

Description:
------------
Does not support = sign in argument value on longoptions

ie: --mydn="dn=foo,ou=Bar,o=My Bar Org,c=NL"

In this case the value for the option 'mydn' becomes 'dn'

Reproduce code:
---------------
--- Getopt.php 2004-07-09 13:29:37.000000000 +0200
+++ Getopt.php.org 2004-07-09 13:34:56.000000000 +0200
@@ -184,7 +184,7 @@
*/
function _parseLongOption($arg, $long_options, &$opts, &$args)
{
- @list($opt, $opt_arg) = explode('=', $arg, 2);
+ @list($opt, $opt_arg) = explode('=', $arg);
$opt_len = strlen($opt);

for ($i = 0; $i < count($long_options); $i++) {

Expected result:
----------------
See patch which fixes the bug

Actual result:
--------------
See patch which fixes the bug