~ubuntu-branches/ubuntu/raring/gengetopt/raring-proposed

« back to all changes in this revision

Viewing changes to doc/cmdline2.c

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-11-15 01:31:28 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20121115013128-nnj2ag7x8v091mkn
Tags: 2.22.6-1
* New upstream release.
* Switch from autotools-dev to dh-autoreconf.
* Refresh patches.
* Bump debhelper requirements to automatically enable hardening.
* Update debian/copyright.
* Bump Standards.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  File autogenerated by gengetopt version 2.22.5
 
2
  File autogenerated by gengetopt version 2.22.6
3
3
  generated with the following command:
4
4
  ../src/gengetopt --input=../../doc/sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts --no-handle-help --no-handle-version 
5
5
 
29
29
 
30
30
const char *gengetopt_args_info_usage = "Usage: " MY_CMDLINE_PARSER_PACKAGE " [OPTIONS]... [FILES]...";
31
31
 
 
32
const char *gengetopt_args_info_versiontext = "";
 
33
 
32
34
const char *gengetopt_args_info_description = "";
33
35
 
34
36
const char *gengetopt_args_info_full_help[] = {
162
164
  printf ("%s %s\n",
163
165
     (strlen(MY_CMDLINE_PARSER_PACKAGE_NAME) ? MY_CMDLINE_PARSER_PACKAGE_NAME : MY_CMDLINE_PARSER_PACKAGE),
164
166
     MY_CMDLINE_PARSER_VERSION);
 
167
 
 
168
  if (strlen(gengetopt_args_info_versiontext) > 0)
 
169
    printf("\n%s\n", gengetopt_args_info_versiontext);
165
170
}
166
171
 
167
172
static void print_help_common(void) {
429
434
int
430
435
my_cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
431
436
{
432
 
  int error = 0;
 
437
  int error_occurred = 0;
433
438
  FIX_UNUSED (additional_error);
434
439
 
435
440
  /* checks for required options */
436
441
  if (! args_info->int_opt_given)
437
442
    {
438
443
      fprintf (stderr, "%s: '--int-opt' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : ""));
439
 
      error = 1;
 
444
      error_occurred = 1;
440
445
    }
441
446
  
442
447
  if (! args_info->long_opt_given)
443
448
    {
444
449
      fprintf (stderr, "%s: '--long-opt' ('-l') option required%s\n", prog_name, (additional_error ? additional_error : ""));
445
 
      error = 1;
 
450
      error_occurred = 1;
446
451
    }
447
452
  
448
453
  
449
454
  /* checks for dependences among options */
450
455
 
451
 
  return error;
 
456
  return error_occurred;
452
457
}
453
458
 
454
459
 
539
544
    if (val) *((long double *)field) = (long double)strtod (val, &stop_char);
540
545
    break;
541
546
  case ARG_LONGLONG:
542
 
#ifdef HAVE_LONG_LONG
543
 
    if (val) *((long long int*)field) = (long long int) strtol (val, &stop_char, 0);
 
547
#if defined(HAVE_LONG_LONG) || defined(HAVE_LONG_LONG_INT)
 
548
    if (val) *((long long int*)field) = (long long int) strtoll (val, &stop_char, 0);
544
549
#else
545
550
    if (val) *((long *)field) = (long)strtol (val, &stop_char, 0);
546
551
#endif
603
608
{
604
609
  int c;        /* Character of the parsed option.  */
605
610
 
606
 
  int error = 0;
 
611
  int error_occurred = 0;
607
612
  struct gengetopt_args_info local_args_info;
608
613
  
609
614
  int override;
848
853
 
849
854
  if (check_required)
850
855
    {
851
 
      error += my_cmdline_parser_required2 (args_info, argv[0], additional_error);
 
856
      error_occurred += my_cmdline_parser_required2 (args_info, argv[0], additional_error);
852
857
    }
853
858
 
854
859
  my_cmdline_parser_release (&local_args_info);
855
860
 
856
 
  if ( error )
 
861
  if ( error_occurred )
857
862
    return (EXIT_FAILURE);
858
863
 
859
864
  if (optind < argc)