]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
make tor-resolve print the Tor version on --version too
authorRoger Dingledine <arma@torproject.org>
Sun, 16 Jan 2005 02:21:14 +0000 (02:21 +0000)
committerRoger Dingledine <arma@torproject.org>
Sun, 16 Jan 2005 02:21:14 +0000 (02:21 +0000)
svn:r3358

src/tools/tor-resolve.c

index f269ee63bb3628a475946bfb587f4ccb5f592106..65a6300cfa1047cede06a0a37a621761ab75349f 100644 (file)
@@ -181,6 +181,11 @@ main(int argc, char **argv)
   if (!n_args)
     usage();
 
+  if (!strcmp(arg[0],"--version")) {
+    printf("Tor version %s.\n",VERSION);
+    return 0;
+  }
+
   if (!strcmp("-v", arg[0])) {
     add_stream_log(LOG_DEBUG, LOG_ERR, "<stderr>", stderr);
     ++arg; --n_args;
@@ -213,7 +218,7 @@ main(int argc, char **argv)
 
   if (network_init()<0) {
     log_fn(LOG_ERR,"Error initializing network; exiting.");
-    return -1;
+    return 1;
   }
 
   if (do_resolve(arg[0], sockshost, socksport, &result))