Browse code

Move help before config file check, so it actually works

Joe cooper authored on 2017/04/28 15:41:25
Showing 1 changed files
... ...
@@ -74,6 +74,11 @@ int main(int argc, char **argv)
74 74
         return 2;
75 75
     }
76 76
 
77
+    if (optget(opts, "help")->enabled) {
78
+        optfree(opts);
79
+        help();
80
+    }
81
+
77 82
     if ((clamdopts = optparse(optget(opts, "config-file")->strarg, 0, NULL, 1, OPT_CLAMD, 0, NULL)) == NULL) {
78 83
         logg("!Can't parse clamd configuration file %s\n", optget(opts, "config-file")->strarg);
79 84
         return 2;
... ...
@@ -97,12 +102,6 @@ int main(int argc, char **argv)
97 97
         exit(0);
98 98
     }
99 99
 
100
-    if (optget(opts, "help")->enabled) {
101
-        optfree(opts);
102
-        optfree(clamdopts);
103
-        help();
104
-    }
105
-
106 100
     if (optget(opts, "infected")->enabled)
107 101
         printinfected = 1;
108 102