From: Tomas V.V.Cox Date: Wed, 23 May 2001 14:38:09 +0000 (+0000) Subject: -Changed $param[0] to $param{0} less ambiguous X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~266 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=881f74263a908e480fc6d3203fd5128d7cbe1ef3;p=php -Changed $param[0] to $param{0} less ambiguous -Readd "-?" param that shows the usage msg --- diff --git a/pear/scripts/pear.in b/pear/scripts/pear.in index 7558b53897..41fdde598d 100644 --- a/pear/scripts/pear.in +++ b/pear/scripts/pear.in @@ -25,7 +25,7 @@ require_once 'Console/Getopt.php'; error_reporting(E_ALL ^ E_NOTICE); -$options = Console_Getopt::getopt($argv, "hv:e:p:d:"); +$options = Console_Getopt::getopt($argv, "h?v:e:p:d:"); if (PEAR::isError($options)) { usage($options); } @@ -38,19 +38,19 @@ foreach ($opts as $opt) { $verbose = $param; break; case 'e': - if ($param[0] != DIRECTORY_SEPARATOR) { + if ($param{0} != DIRECTORY_SEPARATOR) { usage (new PEAR_Error("no absolute path (ej. /usr/lib/php)\n")); } $ext_dir = $param; break; case 'p': - if ($param[0] != DIRECTORY_SEPARATOR) { + if ($param{0} != DIRECTORY_SEPARATOR) { usage (new PEAR_Error("no absolute path (ej. /usr/lib/php)\n")); } $script_dir = $param; break; case 'd': - if ($param[0] != DIRECTORY_SEPARATOR) { + if ($param{0} != DIRECTORY_SEPARATOR) { usage (new PEAR_Error("no absolute path (ej. /usr/lib/php)\n")); } $doc_dir = $param; @@ -104,7 +104,7 @@ function usage($obj = null) " -p set script install dir (absolute path)\n". " -e set extension install dir (absolute path)\n". " -d set documentation dest dir (absolute path)\n". - " -h display help/usage (this message)\n". + " -h, -? display help/usage (this message)\n". "Commands:\n". " install \n". " package [package info file]\n".