Fixed zypper --version
authorMartin Vidner <mvidner@suse.cz>
Sat, 4 Nov 2006 14:34:21 +0000 (14:34 +0000)
committerMartin Vidner <mvidner@suse.cz>
Sat, 4 Nov 2006 14:34:21 +0000 (14:34 +0000)
package/zypper.changes
src/zypper.cc

index af99267..1d5b926 100644 (file)
@@ -1,9 +1,10 @@
 -------------------------------------------------------------------
-Sat Nov  4 15:15:07 CET 2006 - mvidner@suse.cz
+Sat Nov  4 15:33:46 CET 2006 - mvidner@suse.cz
 
 - Ported zypper (except zypp-checkpatches) to libzypp-1.x.x.
 - Show patch messages.
 - Callbacks: fixed more warnings about unused variables.
+- Fixed zypper --version.
 
 -------------------------------------------------------------------
 Fri Nov  3 17:48:09 CET 2006 - mvidner@suse.cz
index 4b5bcc4..f7ae108 100644 (file)
@@ -3,6 +3,9 @@
 
 // (initially based on dmacvicar's zmart)
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <iostream>
 #include <fstream>
 #include <sstream>
@@ -123,11 +126,6 @@ string process_globals(int argc, char **argv)
     "\t--rug-compatible, -r\tTurn on rug compatibility\n"
     ;
 
-  if (gopts.count("version")) {
-    cerr << "zypper 0.1" << endl;
-    return 0;
-  }
-
   if (gopts.count("verbose")) {
     gSettings.verbose += gopts["verbose"].size();
     cerr << "verbosity " << gSettings.verbose << endl;
@@ -168,6 +166,13 @@ string process_globals(int argc, char **argv)
     if (help) {
       cerr << help_global_options << help_commands;
     }
+    else if (gopts.count("version")) {
+      cerr << PACKAGE_STRING;
+#ifdef LIBZYPP_1xx
+      cerr << " (libzypp-1.x.x)";
+#endif
+      cerr << endl;
+    }
     else {
       cerr << "Try -h for help" << endl;
     }