]> granicus.if.org Git - php/commitdiff
The command name is now the first arg not the second
authorTomas V.V.Cox <cox@php.net>
Sun, 12 May 2002 16:42:50 +0000 (16:42 +0000)
committerTomas V.V.Cox <cox@php.net>
Sun, 12 May 2002 16:42:50 +0000 (16:42 +0000)
pear/scripts/pear.in

index edcbc8900d3410ddb243ce2992c6ada675cd8c3f..f1d7a4e5585cbade9a63ce949166971b68516201 100644 (file)
@@ -116,7 +116,7 @@ if ($store_user_config) {
     $config->store('user');
 }
 
-$command = (isset($options[1][1])) ? $options[1][1] : null;
+$command = (isset($options[1][0])) ? $options[1][0] : null;
 
 if (empty($command) && ($store_user_config || $store_system_config)) {
     exit;
@@ -128,13 +128,13 @@ if ($fetype == 'Gtk') {
     if (empty($all_commands[$command]) || $command == 'help') {
         usage(null, @$options[1][2]);
     }
-    
+
     $cmd = PEAR_Command::factory($command, $config);
     if (PEAR::isError($cmd)) {
         die($cmd->getMessage());
     }
-    
-    $cmdargs = array_slice($options[1], 2);
+
+    $cmdargs = array_slice($options[1], 1);
     $ok = $cmd->run($command, $cmdopts, $cmdargs);
     if ($ok === false) {
         PEAR::raiseError("unknown command `$command'");