From: Tomas V.V.Cox Date: Sun, 19 May 2002 15:50:36 +0000 (+0000) Subject: Put "pear help options" working again X-Git-Tag: RELEASE_0_4~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93b603861e1ac3c0183f26ef23e6e9f32f971aec;p=php Put "pear help options" working again --- diff --git a/pear/scripts/pear.in b/pear/scripts/pear.in index 99d6d93c67..30b6f3aefa 100644 --- a/pear/scripts/pear.in +++ b/pear/scripts/pear.in @@ -16,8 +16,10 @@ // +----------------------------------------------------------------------+ // | Authors: Stig Bakken | // | Tomas V.V.Cox | +// | | // +----------------------------------------------------------------------+ // +// $Id$ ini_set('allow_url_fopen', true); set_time_limit(0); @@ -128,14 +130,14 @@ if ($fetype == 'Gtk') { Gtk::main(); } else do { if (empty($all_commands[$command]) || $command == 'help') { - usage(null, @$options[1][2]); + usage(null, @$options[1][0]); } $cmd = PEAR_Command::factory($command, $config); if (PEAR::isError($cmd)) { die($cmd->getMessage()); } - + $short_args = $long_args = null; PEAR_Command::getGetoptArgs($command, $short_args, $long_args); if (PEAR::isError($tmp = Console_Getopt::getopt($options[1], $short_args, $long_args))) { @@ -217,9 +219,9 @@ function cmdHelp($command) " -h, -? display help/usage (this message)\n"; } elseif ($help = PEAR_Command::getHelp($command)) { if (is_string($help)) { - return "Usage : $help"; + return "$help\n"; } - return "Usage : $progname $command {$help[0]}\n{$help[1]}"; + return "{$help[0]}\n{$help[1]}"; } return "No such command"; }