From: Tim Starling Date: Sun, 16 Apr 2006 06:29:44 +0000 (+0000) Subject: Argument with -- alone specifies that the following arguments are not options X-Git-Tag: 1.31.0-rc.0~57481 X-Git-Url: http://git.cyclocoop.org/data/%7BGarradin/WEBSITE%7D?a=commitdiff_plain;h=d5b370f1bcccfa16746db64874301c10e750418d;p=lhc%2Fweb%2Fwiklou.git Argument with -- alone specifies that the following arguments are not options --- diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index b8188e6380..416a8877d8 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -39,7 +39,15 @@ $args = array(); # Parse arguments for( $arg = reset( $argv ); $arg !== false; $arg = next( $argv ) ) { - if ( substr( $arg, 0, 2 ) == '--' ) { + if ( $arg == '--' ) { + # End of options, remainder should be considered arguments + $arg = next( $argv ); + while( $arg !== false ) { + $args[] = $arg; + $arg = next( $argv ); + } + break; + } elseif ( substr( $arg, 0, 2 ) == '--' ) { # Long options $option = substr( $arg, 2 ); if ( in_array( $option, $optionsWithArgs ) ) {