help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-gengetopt] Bug in gengetopt (hidden options and no-handle-help)


From: Thomas Boehne
Subject: [help-gengetopt] Bug in gengetopt (hidden options and no-handle-help)
Date: Thu, 03 May 2007 10:40:21 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060916)

address@hidden:~/TiCo-MG/test3/cmd_test1 1$ gengetopt --version
GNU gengetopt 2.19.1
[...]

contents of file "test.ggo":
purpose "Foo"
package "bar"
version "1.00.00"

option "par1" - "par 1" string required
option "par2" P "par 2" string optional hidden

invocation of gengetopt:
$ gengetopt --input=test.ggo --no-handle-help


Now cmdline.c contains this:

       case 0: /* Long option with no short option */
          /* Print help, including hidden options, and exit.  */
          if (strcmp (long_options[option_index].name, "full-help") == 0)
          {
            if (local_args_info.full_help_given)
              {
                fprintf (stderr, "%s: `--full-help' option given more than 
once%s\n", argv[0], (additional_error ? additional_error : ""));
                goto failure;
              }
            if (args_info->full_help_given && ! override)
              continue;
            local_args_info.full_help_given = 1;
            args_info->full_help_given = 1;

          }
          cmdline_parser_free (&local_args_info);
            return 0;

          /* par 1.  */
          if (strcmp (long_options[option_index].name, "par1") == 0)
          [...]

The code for "par 1" will never be reached, because of the return 0. I
guess it is a bug that only occurs with no-handle-help and hidden
options, but I was not able to really track it down. Maybe somebody
with more knowledge of the gengetopt-code can look into this.

Best regards
Thomas Böhne

-- 
**************************************************************************
* Jäger Computergesteuerte Messtechnik GmbH
* Thomas Böhne
* Rheinstraße 2-4
* 64653 Lorsch, Germany
* http://www.ADwin.de
* Phone: +49 (6251) 9632-0                  Fax: +49 (6251) 56819
**************************************************************************
* Responsible: C.E.O. Hubert Morgenstern
* Commercial Register: Amtsgericht Bensheim, Register no.: B24717
**************************************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]