1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20: #include <argp.h>
21:
22: static const struct argp_option opt1[] =
23: {
24: { "opt1", '1', "NUMBER", 0, "Option 1" },
25: { NULL, 0, NULL, 0, NULL }
26: };
27:
28: static const struct argp_option opt2[] =
29: {
30: { "opt2", '2', "NUMBER", 0, "Option 2" },
31: { NULL, 0, NULL, 0, NULL }
32: };
33:
34: static const struct argp_option opt3[] =
35: {
36: { "opt3", '3', "NUMBER", 0, "Option 3" },
37: { NULL, 0, NULL, 0, NULL }
38: };
39:
40: static const struct argp_option opt4[] =
41: {
42: { "opt4", '4', "NUMBER", 0, "Option 4" },
43: { NULL, 0, NULL, 0, NULL }
44: };
45:
46: static const struct argp_option opt5[] =
47: {
48: { "opt5", '5', "NUMBER", 0, "Option 5" },
49: { NULL, 0, NULL, 0, NULL }
50: };
51:
52: static struct argp argp5 =
53: {
54: opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL
55: };
56:
57: static struct argp argp4 =
58: {
59: opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL
60: };
61:
62: static struct argp argp3 =
63: {
64: opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL
65: };
66:
67: static struct argp_child children2[] =
68: {
69: { &argp4, 0, "child3", 3 },
70: { &argp5, 0, "child4", 4 },
71: { NULL, 0, NULL, 0 }
72: };
73:
74: static struct argp argp2 =
75: {
76: opt2, NULL, "args doc2", "doc2", children2, NULL, NULL
77: };
78:
79: static struct argp_child children1[] =
80: {
81: { &argp2, 0, "child1", 1 },
82: { &argp3, 0, "child2", 2 },
83: { NULL, 0, NULL, 0 }
84: };
85:
86: static struct argp argp1 =
87: {
88: opt1, NULL, "args doc1", "doc1", children1, NULL, NULL
89: };
90:
91:
92: static int
93: do_test (void)
94: {
95: argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2");
96: return 0;
97: }
98:
99:
100: #define TEST_FUNCTION do_test ()
101: #include "../test-skeleton.c"