Browse Source

be flexible in what you accept: when people type "tor --install" thinking
they had typed "tor -install", make it work too.


svn:r4526

Roger Dingledine 20 years ago
parent
commit
2f1f0c8d21
1 changed files with 9 additions and 7 deletions
  1. 9 7
      src/or/main.c

+ 9 - 7
src/or/main.c

@@ -1672,13 +1672,15 @@ tor_main(int argc, char *argv[])
 #ifdef MS_WINDOWS_SERVICE
   backup_argv = argv;
   backup_argc = argc;
-  if ((argc >= 2) && !strcmp(argv[1], "-install"))
-    return nt_service_install();
-  if ((argc >= 2) && !strcmp(argv[1], "-remove"))
-    return nt_service_remove();
-  if ((argc >= 2) && !strcmp(argv[1], "--nt-service")) {
-    nt_service_main();
-    return 0;
+  if (argc >= 2) {
+    if (!strcmp(argv[1], "-install") || !strcmp(argv[1], "--install"))
+      return nt_service_install();
+    if (!strcmp(argv[1], "-remove") || !strcmp(argv[1], "--remove"))
+      return nt_service_remove();
+    if (!strcmp(argv[1], "-nt-service") || !strcmp(argv[1], "--nt-service")) {
+      nt_service_main();
+      return 0;
+    }
   }
 #endif
   if (tor_init(argc, argv)<0)