pgqd: fix help string, detect --help
authorMarko Kreen <markokr@gmail.com>
Tue, 27 Apr 2010 12:42:17 +0000 (15:42 +0300)
committerMarko Kreen <markokr@gmail.com>
Tue, 27 Apr 2010 12:42:17 +0000 (15:42 +0300)
sql/ticker/pgqd.c

index f175b09b3ab33bddf3508240e26d3af9b90e91e2..4b9d48843c771b73295b0a1c5465adeea87524db 100644 (file)
 static void detect_dbs(void);
 static void recheck_dbs(void);
 
-static const char *usage_str =
+static const char usage_str[] =
 "usage: pgq-ticker [switches] config.file\n"
 "Switches:\n"
 "  -v        Increase verbosity\n"
 "  -q        No output to console\n"
 "  -d        Daemonize\n"
-"  -H        Show help\n"
+"  -h        Show help\n"
 "  -V        Show version\n"
 " --ini      Show sample config file\n"
 "";
@@ -276,6 +276,10 @@ int main(int argc, char *argv[])
                        printf("%s", sample_ini);
                        exit(0);
                }
+               if (!strcmp(argv[c], "--help")) {
+                       printf(usage_str);
+                       exit(0);
+               }
        }
 
        while ((c = getopt(argc, argv, "dqvhV")) != -1) {