1 /* Copyright (C) 2007-2022 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
20 static const struct argp_option opt1
[] =
22 { "opt1", '1', "NUMBER", 0, "Option 1" },
23 { NULL
, 0, NULL
, 0, NULL
}
26 static const struct argp_option opt2
[] =
28 { "opt2", '2', "NUMBER", 0, "Option 2" },
29 { NULL
, 0, NULL
, 0, NULL
}
32 static const struct argp_option opt3
[] =
34 { "opt3", '3', "NUMBER", 0, "Option 3" },
35 { NULL
, 0, NULL
, 0, NULL
}
38 static const struct argp_option opt4
[] =
40 { "opt4", '4', "NUMBER", 0, "Option 4" },
41 { NULL
, 0, NULL
, 0, NULL
}
44 static const struct argp_option opt5
[] =
46 { "opt5", '5', "NUMBER", 0, "Option 5" },
47 { NULL
, 0, NULL
, 0, NULL
}
50 static struct argp argp5
=
52 opt5
, NULL
, "args doc5", "doc5", NULL
, NULL
, NULL
55 static struct argp argp4
=
57 opt4
, NULL
, "args doc4", "doc4", NULL
, NULL
, NULL
60 static struct argp argp3
=
62 opt3
, NULL
, "args doc3", "doc3", NULL
, NULL
, NULL
65 static struct argp_child children2
[] =
67 { &argp4
, 0, "child3", 3 },
68 { &argp5
, 0, "child4", 4 },
72 static struct argp argp2
=
74 opt2
, NULL
, "args doc2", "doc2", children2
, NULL
, NULL
77 static struct argp_child children1
[] =
79 { &argp2
, 0, "child1", 1 },
80 { &argp3
, 0, "child2", 2 },
84 static struct argp argp1
=
86 opt1
, NULL
, "args doc1", "doc1", children1
, NULL
, NULL
93 argp_help (&argp1
, stdout
, ARGP_HELP_LONG
, (char *) "tst-argp2");
98 #define TEST_FUNCTION do_test ()
99 #include "../test-skeleton.c"