Help now works in the shell (by Dominique Leuenberger, #299818).
authorMartin Vidner <mvidner@suse.cz>
Fri, 24 Aug 2007 06:48:18 +0000 (06:48 +0000)
committerMartin Vidner <mvidner@suse.cz>
Fri, 24 Aug 2007 06:48:18 +0000 (06:48 +0000)
package/zypper.changes
src/zypper-command.cc
src/zypper.cc

index 1408583..3867a1b 100644 (file)
@@ -1,4 +1,9 @@
 -------------------------------------------------------------------
+Fri Aug 24 08:48:07 CEST 2007 - mvidner@suse.cz
+
+- Help now works in the shell (by Dominique Leuenberger, #299818).
+
+-------------------------------------------------------------------
 Thu Aug 23 17:21:55 CEST 2007 - mvidner@suse.cz
 
 - Shell stopped working at all; fixed (#301666).
index 4c8c6e6..89c1998 100644 (file)
@@ -73,7 +73,7 @@ ZypperCommand::Command ZypperCommand::parse(const std::string & strval_r)
     _table["patches"] = _table["pch"] = ZypperCommand::SHOW_PATCHES_e;
     _table["xml-updates"] = _table["xu"] = ZypperCommand::XML_LIST_UPDATES_PATCHES_e;
 
-    _table["help"] = ZypperCommand::HELP_e;
+    _table["help"] = _table["?"] = ZypperCommand::HELP_e;
     _table["shell"] = _table["sh"] = ZypperCommand::SHELL_e;
     _table["quit"] = _table["exit"] = _table["\004"] = ZypperCommand::SHELL_QUIT_e;
     _table["NONE"] = _table["none"] = _table[""] = ZypperCommand::NONE_e;
index e5981bf..cac772f 100644 (file)
@@ -78,6 +78,29 @@ Url make_url (const string & url_s) {
 }
 
 bool ghelp = false;
+  static string help_commands = _(
+    "  Commands:\n"
+    "\thelp, ?\t\t\tHelp\n"
+    "\tshell, sh\t\tAccept multiple commands at once\n"
+    "\tinstall, in\t\tInstall packages or resolvables\n"
+    "\tremove, rm\t\tRemove packages or resolvables\n"
+    "\tsearch, se\t\tSearch for packages matching a pattern\n"
+    "\trepos, lr\t\tList all defined repositories.\n"
+    "\taddrepo, ar\t\tAdd a new repository\n"
+    "\tremoverepo, rr\t\tRemove specified repository\n"
+    "\trenamerepo, nr\t\tRename specified repository\n"
+    "\tmodifyrepo, mr\t\tModify specified repository\n"
+    "\trefresh, ref\t\tRefresh all repositories\n"
+    "\tpatch-check, pchk\tCheck for patches\n"
+    "\tpatches, pch\t\tList patches\n"
+    "\tlist-updates, lu\tList updates\n"
+    "\txml-updates, xu\t\tList updates and patches in xml format\n"
+    "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
+    "\tinfo, if\t\tShow full information for packages\n"
+    "\tpatch-info\t\tShow full information for patches\n"
+    "\tsource-install, si\tInstall a source package\n"
+    "");
+
 
 /*
  * parses global options, returns the command
@@ -120,29 +143,6 @@ void process_globals(int argc, char **argv)
     "\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
     "\t--root, -R <dir>\tOperate on a different root directory.\n");
 
-  static string help_commands = _(
-    "  Commands:\n"
-    "\thelp\t\t\tHelp\n"
-    "\tshell, sh\t\tAccept multiple commands at once\n"
-    "\tinstall, in\t\tInstall packages or resolvables\n"
-    "\tremove, rm\t\tRemove packages or resolvables\n"
-    "\tsearch, se\t\tSearch for packages matching a pattern\n"
-    "\trepos, lr\t\tList all defined repositories.\n"
-    "\taddrepo, ar\t\tAdd a new repository\n"
-    "\tremoverepo, rr\t\tRemove specified repository\n"
-    "\trenamerepo, nr\t\tRename specified repository\n"
-    "\tmodifyrepo, mr\t\tModify specified repository\n"
-    "\trefresh, ref\t\tRefresh all repositories\n"
-    "\tpatch-check, pchk\tCheck for patches\n"
-    "\tpatches, pch\t\tList patches\n"
-    "\tlist-updates, lu\tList updates\n"
-    "\txml-updates, xu\t\tList updates and patches in xml format\n"
-    "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
-    "\tinfo, if\t\tShow full information for packages\n"
-    "\tpatch-info\t\tShow full information for patches\n"
-    "\tsource-install, si\tInstall a source package\n"
-    "");
-
   if (gopts.count("rug-compatible"))
     gSettings.is_rug_compatible = true;
 
@@ -256,7 +256,7 @@ int one_command(int argc, char **argv)
 
   if (command == ZypperCommand::HELP)
   {
-    //cout << help_global_options << endl << help_commands;
+    cout << help_commands;
   }
   else if (command == ZypperCommand::INSTALL) {
     static struct option install_options[] = {