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>
13 int main(int argc, char *argv[])
15 unsigned j, i, len = 0;
19 for (j = 0; j < 2; j ++) {
21 /* Giving subtable a title makes an extra entry! */
22 opt_register_table(subtables, j == 0 ? NULL : "subtable");
24 p = first_lopt(&i, &len);
27 ok1(strncmp(p, "jjj", len) == 0);
28 p = next_lopt(p, &i, &len);
31 ok1(strncmp(p, "lll", len) == 0);
32 p = next_lopt(p, &i, &len);
35 ok1(strncmp(p, "mmm", len) == 0);
36 p = next_lopt(p, &i, &len);
39 ok1(strncmp(p, "ddd", len) == 0);
40 p = next_lopt(p, &i, &len);
43 ok1(strncmp(p, "eee", len) == 0);
44 p = next_lopt(p, &i, &len);
47 ok1(strncmp(p, "ggg", len) == 0);
48 p = next_lopt(p, &i, &len);
51 ok1(strncmp(p, "hhh", len) == 0);
52 p = next_lopt(p, &i, &len);