- unused code removed
authorJan Kupec <jkupec@suse.cz>
Fri, 16 Nov 2007 18:21:04 +0000 (18:21 +0000)
committerJan Kupec <jkupec@suse.cz>
Fri, 16 Nov 2007 18:21:04 +0000 (18:21 +0000)
- report 'too few arguments' for install/remove if none specified

src/zypper.cc
src/zypper.h

index 55e5dcf..d9d53f5 100644 (file)
@@ -1121,30 +1121,24 @@ int one_command(int argc, char **argv)
   else if (command == ZypperCommand::INSTALL ||
            command == ZypperCommand::REMOVE)
   {
-    if (command == ZypperCommand::INSTALL) {
-      if (ghelp || arguments.size() < 1) {
-        cerr << specific_help;
-        return !ghelp;
-      }
-
-      gData.packages_to_install = arguments;
-
-      if (copts.count("auto-agree-with-licenses")
-          || copts.count("agree-to-third-party-licenses"))
-        gSettings.license_auto_agree = true;
+    if (ghelp)
+    {
+      cout << specific_help;
+      return ZYPPER_EXIT_OK;
     }
 
-    
-    
-    if (command == ZypperCommand::REMOVE) {
-      if (ghelp || arguments.size() < 1) {
-        cerr << specific_help;
-        return !ghelp;
-      }
-
-      gData.packages_to_uninstall = arguments;
+    if (arguments.size() < 1)
+    {
+      cerr << _("Too few arguments.");
+      cerr << " " << _("At least one package name is required.") << endl << endl;
+      cerr << specific_help;
+      return ZYPPER_EXIT_ERR_INVALID_ARGS;
     }
 
+    if (copts.count("auto-agree-with-licenses")
+        || copts.count("agree-to-third-party-licenses"))
+      gSettings.license_auto_agree = true;
+
     // check root user
     if (geteuid() != 0)
     {
index b3e334c..393297d 100644 (file)
@@ -61,8 +61,6 @@ struct RuntimeData
   std::list<zypp::RepoInfo> repos;
   int patches_count;
   int security_patches_count;
-  std::vector<std::string> packages_to_install;
-  std::vector<std::string> packages_to_uninstall; 
   zypp::ResStore repo_resolvables;
   zypp::ResStore target_resolvables;
   zypp::RepoInfo current_repo;