1 #include <ccan/tap/tap.h>
7 #include <ccan/opt/opt.c>
8 #include <ccan/opt/usage.c>
9 #include <ccan/opt/helpers.c>
10 #include <ccan/opt/parse.c>
12 static void reset_options(void)
16 opt_count = opt_num_short = opt_num_short_arg = opt_num_long = 0;
20 int main(int argc, char *argv[])
22 unsigned j, i, len = 0;
26 for (j = 0; j < 2; j ++) {
28 /* Giving subtable a title makes an extra entry! */
29 opt_register_table(subtables, j == 0 ? NULL : "subtable");
31 p = first_lopt(&i, &len);
34 ok1(strncmp(p, "jjj", len) == 0);
35 p = next_lopt(p, &i, &len);
38 ok1(strncmp(p, "lll", len) == 0);
39 p = next_lopt(p, &i, &len);
42 ok1(strncmp(p, "mmm", len) == 0);
43 p = next_lopt(p, &i, &len);
46 ok1(strncmp(p, "ddd", len) == 0);
47 p = next_lopt(p, &i, &len);
50 ok1(strncmp(p, "eee", len) == 0);
51 p = next_lopt(p, &i, &len);
54 ok1(strncmp(p, "ggg", len) == 0);
55 p = next_lopt(p, &i, &len);
58 ok1(strncmp(p, "hhh", len) == 0);
59 p = next_lopt(p, &i, &len);