From e988dac87c714b92969c73804b6a4f89ea9a731d Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Sun, 1 May 2016 17:19:27 -0400 Subject: [PATCH] Added -v command line option to print version number modified: src/main.c --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3fae0be..f472021 100644 --- a/src/main.c +++ b/src/main.c @@ -4,17 +4,22 @@ #include #include "nms.h" +#define VERSION "0.1.0" + int main(int argc, char *argv[]) { int c, o, inSize = 0; char *input = NULL; NmsArgs args = INIT_NMSARGS; // Processing command arguments - while ((o = getopt(argc, argv, "a")) != -1) { + while ((o = getopt(argc, argv, "av")) != -1) { switch (o) { case 'a': args.auto_decrypt = true; break; + case 'v': + printf("nms version " VERSION "\n"); + return 0; case '?': if (isprint(optopt)) fprintf (stderr, "Unknown option '-%c'.\n", optopt);