Added -v command line option to print version number
modified: src/main.c
This commit is contained in:
parent
ed5e9f689f
commit
e988dac87c
@ -4,17 +4,22 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "nms.h"
|
#include "nms.h"
|
||||||
|
|
||||||
|
#define VERSION "0.1.0"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int c, o, inSize = 0;
|
int c, o, inSize = 0;
|
||||||
char *input = NULL;
|
char *input = NULL;
|
||||||
NmsArgs args = INIT_NMSARGS;
|
NmsArgs args = INIT_NMSARGS;
|
||||||
|
|
||||||
// Processing command arguments
|
// Processing command arguments
|
||||||
while ((o = getopt(argc, argv, "a")) != -1) {
|
while ((o = getopt(argc, argv, "av")) != -1) {
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case 'a':
|
case 'a':
|
||||||
args.auto_decrypt = true;
|
args.auto_decrypt = true;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
printf("nms version " VERSION "\n");
|
||||||
|
return 0;
|
||||||
case '?':
|
case '?':
|
||||||
if (isprint(optopt))
|
if (isprint(optopt))
|
||||||
fprintf (stderr, "Unknown option '-%c'.\n", optopt);
|
fprintf (stderr, "Unknown option '-%c'.\n", optopt);
|
||||||
|
Loading…
Reference in New Issue
Block a user