1
/* test_no_handle_help.c test */
3
/* test manual handling of help and version */
8
#include "test_no_handle_help_cmd.h"
10
static struct gengetopt_args_info args_info;
13
main (int argc, char **argv)
16
/* if --help is specified with other options, do not print
17
the complete output of help, but only the description of that option */
18
short help_printed = 0;
20
if (test_no_handle_help_cmd_parser (argc, argv, &args_info) != 0) {
25
printf("####################\n# HEADER\n####################\n");
27
if (args_info.detailed_help_given)
28
test_no_handle_help_cmd_parser_print_detailed_help();
30
if (args_info.version_given)
31
test_no_handle_help_cmd_parser_print_version();
33
if (args_info.height_given) {
34
printf ("specified --height %d\n", args_info.height_arg);
35
if (args_info.help_given) {
36
printf ("%s\n", args_info.height_help);
41
if (args_info.vavoom_given) {
42
printf ("specified --vavoom %s\n", args_info.vavoom_arg);
43
if (args_info.help_given) {
44
printf ("%s\n", args_info.vavoom_help);
49
if (args_info.help_given && !help_printed)
50
test_no_handle_help_cmd_parser_print_help();
52
printf("####################\n# FOOTER\n####################\n");
55
test_no_handle_help_cmd_parser_free (&args_info);