From: Brion Vibber Date: Mon, 18 Oct 2004 08:10:22 +0000 (+0000) Subject: Support setting values for long options like --color=yes X-Git-Tag: 1.5.0alpha1~1520 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=ee69a12255bcdc21c59d18bca8da0177f5c8a5ca;p=lhc%2Fweb%2Fwiklou.git Support setting values for long options like --color=yes --- diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index fb5a8d8a58..463366ef3f 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -41,7 +41,14 @@ for( $arg = reset( $argv ); $arg !== false; $arg = next( $argv ) ) { } $options[$option] = $param; } else { - $options[$option] = 1; + $bits = explode( '=', $option, 2 ); + if( count( $bits ) > 1 ) { + $option = $bits[0]; + $param = $bits[1]; + } else { + $param = 1; + } + $options[$option] = $param; } } elseif ( $arg{0} == '-' ) { # Short options