2 #include <ccan/tap/tap.h>
8 #include <ccan/opt/opt.c>
9 #include <ccan/opt/usage.c>
10 #include <ccan/opt/helpers.c>
11 #include <ccan/opt/parse.c>
13 static void reset_options(void)
17 opt_count = opt_num_short = opt_num_short_arg = opt_num_long = 0;
21 int main(int argc, char *argv[])
23 unsigned j, i, len = 0;
27 for (j = 0; j < 2; j ++) {
29 /* Giving subtable a title makes an extra entry! */
30 opt_register_table(subtables, j == 0 ? NULL : "subtable");
32 p = first_lopt(&i, &len);
35 ok1(strncmp(p, "jjj", len) == 0);
36 p = next_lopt(p, &i, &len);
39 ok1(strncmp(p, "lll", len) == 0);
40 p = next_lopt(p, &i, &len);
43 ok1(strncmp(p, "mmm", len) == 0);
44 p = next_lopt(p, &i, &len);
47 ok1(strncmp(p, "ddd", len) == 0);
48 p = next_lopt(p, &i, &len);
51 ok1(strncmp(p, "eee", len) == 0);
52 p = next_lopt(p, &i, &len);
55 ok1(strncmp(p, "ggg", len) == 0);
56 p = next_lopt(p, &i, &len);
59 ok1(strncmp(p, "hhh", len) == 0);
60 p = next_lopt(p, &i, &len);