"help foo" now works like "foo --help" (by Dominique Leuenberger, #299818).
authorMartin Vidner <mvidner@suse.cz>
Tue, 28 Aug 2007 15:53:35 +0000 (15:53 +0000)
committerMartin Vidner <mvidner@suse.cz>
Tue, 28 Aug 2007 15:53:35 +0000 (15:53 +0000)
package/zypper.changes
src/zypper.cc

index 2f8d482..df13292 100644 (file)
@@ -1,4 +1,9 @@
 -------------------------------------------------------------------
+Tue Aug 28 17:51:43 CEST 2007 - mvidner@suse.cz
+
+- "help foo" now works like "foo --help" (by Dominique Leuenberger, #299818).
+
+-------------------------------------------------------------------
 Tue Aug 28 17:40:25 CEST 2007 - kkaempf@suse.de
 
 - support "-r" (limit to repo) on search (#305384)
index dde6121..ded17a5 100644 (file)
@@ -255,6 +255,15 @@ int one_command(int argc, char **argv)
 //      "\t--disable-system-resolvables, -T\t\tDo not read system installed resolvables\n"
 //      );
 
+  if ( (command == ZypperCommand::HELP) && (argc > 1) )
+  try {
+    ghelp = true;
+    command = ZypperCommand(argv[1]);
+  }
+  catch (Exception & ex) {
+    // in case of an unknown command specified to help, an exception is thrown
+  }
+
   if (command == ZypperCommand::HELP)
   {
     cout << help_commands;