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
|
#include <stdio.h>
#include <getopt.h>
#include "submodule/log.c-patched/src/log.h"
#define dbgchr(x) log_info("%c", x)
static int parseopt(int argc, char **argv)
{
int optcounter = 0;
int c = 0;
static struct option opt_table[] = {
{"mode", required_argument, 0, 'm'},
{0, 0, 0, 0}
};
while(1) {
c = getopt_long(argc, argv, "m:", opt_table, &optcounter);
dbgchr(c);
if (c == -1)
break;
}
}
int main(int argc, char **argv)
{
parseopt(argc, argv);
}
|