diff --git a/src/suricata.c b/src/suricata.c index f14f94431f..b28b0740a5 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -261,6 +261,7 @@ void EngineKill(void) { void usage(const char *progname) { + printf("%s %s\n", PROG_NAME, PROG_VER); printf("USAGE: %s\n\n", progname); printf("\t-c : path to configuration file\n"); printf("\t-i : run in pcap live mode\n"); @@ -318,7 +319,7 @@ int main(int argc, char **argv) /* getopt_long stores the option index here. */ int option_index = 0; - char short_opts[] = "c:Dhi:l:q:r:us:U:"; + char short_opts[] = "c:Dhi:l:q:r:us:U:V"; while ((opt = getopt_long(argc, argv, short_opts, long_opts, &option_index)) != -1) { switch (opt) { @@ -411,12 +412,17 @@ int main(int argc, char **argv) regex_arg = NULL; #endif break; + case 'V': + printf("\nThis is %s version %s\n\n", PROG_NAME, PROG_VER); + exit(EXIT_SUCCESS); default: usage(argv[0]); exit(EXIT_FAILURE); } } + SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER); + if (!CheckValidDaemonModes(daemon, mode)) { exit(EXIT_FAILURE); } diff --git a/src/suricata.h b/src/suricata.h index 0ec31ef8d5..35e1c7d47e 100644 --- a/src/suricata.h +++ b/src/suricata.h @@ -13,7 +13,8 @@ #include "packet-queue.h" /* the name of our binary */ -#define PROG_NAME "suricata" +#define PROG_NAME "Suricata" +#define PROG_VER "0.8" /* max packets processed simultaniously */ #define MAX_PENDING 50