-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
37 lines (35 loc) · 877 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "command_struct.h"
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
const char *cmdLineOption = argv[1]; // First command line argument
const int length = strlen(cmdLineOption);
const struct CommandOption *option = in_word_set(cmdLineOption, strlen(cmdLineOption));
if(option)
{
switch (option->OptionCode)
{
case FOO :
printf("foo\n");
break;
case BAR :
printf("bar\n");
break;
case THING1 :
printf("thing1\n");
break;
case THING2 :
printf("thing2\n");
break;
default:
// dead code
break;
}
}
else
{
printf("Option not found\n");
}
return 0;
}