From: Stig Bakken Date: Sun, 26 May 2002 12:13:47 +0000 (+0000) Subject: * POSIX getopt compatibility support (first argv element is the command) X-Git-Tag: RELEASE_0_10~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39ba3636382d3f9cba39a162688bd10e30159e06;p=php * POSIX getopt compatibility support (first argv element is the command) --- diff --git a/pear/Console/Getopt.php b/pear/Console/Getopt.php index c82aabba34..834ab8c504 100644 --- a/pear/Console/Getopt.php +++ b/pear/Console/Getopt.php @@ -77,6 +77,9 @@ class Console_Getopt { if ($long_options) sort($long_options); + if ($args[0]{0} != '-') { + array_shift($args); + } reset($args); while (list($i, $arg) = each($args)) { diff --git a/pear/package-Console_Getopt.xml b/pear/package-Console_Getopt.xml index c0ffb9f196..067893e3a4 100644 --- a/pear/package-Console_Getopt.xml +++ b/pear/package-Console_Getopt.xml @@ -17,15 +17,17 @@ short and long options. ssb - helper + developer Stig Bakken stig@php.net - 0.10 - 2002-05-12 - Packaging fix + 0.11 + 2002-05-26 + POSIX getopt compatibility fix: treat first element of args +array as command name + beta @@ -34,6 +36,12 @@ short and long options. + + 0.10 + 2002-05-12 + Packaging fix + beta + 0.9 2002-05-12