File: main2.c

package info (click to toggle)
gengetopt 2.22.6+dfsg0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,732 kB
  • sloc: cpp: 14,709; sh: 11,845; ansic: 8,030; makefile: 689; yacc: 514; lex: 171; sed: 3
file content (41 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* sample2.c */

/* If we use autoconf.  */
#ifdef HAVE_CONFIG_H
#	include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>

#include "cmdline2.h"

int
main (int argc, char **argv)
{
  struct gengetopt_args_info args_info;

  /* let's call our cmdline parser */
  if (my_cmdline_parser (argc, argv, &args_info) != 0)
    exit(1) ;

  if (args_info.help_given)
    {
      printf ("This is a simple test for gengetopt\n");
      my_cmdline_parser_print_help ();
    }

  if (args_info.full_help_given)
    {
      printf ("This is a simple test for gengetopt\n");
      my_cmdline_parser_print_full_help ();
    }

  if (args_info.version_given)
    {
      printf ("Here is the version\n");
      my_cmdline_parser_print_version ();
    }

  return 0;
}