]> granicus.if.org Git - php/commitdiff
Give the right error when wrong params given to package-info and
authorTomas V.V.Cox <cox@php.net>
Tue, 16 Apr 2002 00:22:55 +0000 (00:22 +0000)
committerTomas V.V.Cox <cox@php.net>
Tue, 16 Apr 2002 00:22:55 +0000 (00:22 +0000)
fix/add help some help messages

pear/PEAR/Command/Package.php

index 40d7e6d0fd896675a2657f23638c3fc77090de92..85bade842a9543b05cac1db6c6334bcbd792a584 100644 (file)
@@ -93,11 +93,12 @@ class PEAR_Command_Package extends PEAR_Command_Common
                              'Creates a PEAR package from its description file (usually '.
                              "named as package.xml)\n".
                              "   -n    Return only the created package file name. Useful for\n".
-                             "         shell script operations.");
+                             "         shell script operations.\n".
+                             "   -Z    Do not compress the tar package");
             case 'package-list':
                 return array('<pear package>',
-                             'List the contents of a PEAR package');
-            case 'packge-info':
+                             'List the contents (the files) of a PEAR package');
+            case 'package-info':
                 return array('<pear package>',
                              'Shows information about a PEAR package');
             case 'package-validate':
@@ -170,7 +171,7 @@ class PEAR_Command_Package extends PEAR_Command_Common
             // {{{ package-list
 
             case 'package-list': {
-                // $params[0] -> the PEAR package to list its contents
+                // $params[0] -> the PEAR package to list its files
                 if (sizeof($params) != 1) {
                     $failmsg = "Command package-list requires a valid PEAR package filename ".
                                " as the first argument. Try the command \"help package-list\"";
@@ -221,6 +222,13 @@ class PEAR_Command_Package extends PEAR_Command_Common
             // {{{ package-info
 
             case 'package-info': {
+                // $params[0] -> the PEAR package to list its information
+                if (sizeof($params) != 1) {
+                    $failmsg = "Command package-info requires a valid PEAR package filename ".
+                               " as the first argument. Try the command \"help package-info\"";
+                    break;
+                }
+
                 $obj = new PEAR_Common();
                 if (PEAR::isError($info = $obj->infoFromTgzFile($params[0]))) {
                     return $info;