From 974498fdc84bb024ee901e48a60be1a8abeddc2a Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sat, 1 Oct 2011 19:26:11 +0100
Subject: [PATCH 2/2] options: rename --unamed-opts to --unnamed-opts, keeping old name as synonym

---
 doc/Makefile.am       |    2 +-
 doc/README.example    |    2 +-
 doc/gengetopt.info    |  821 ++++++++-----------------------------------------
 doc/gengetopt.texinfo |    8 +-
 doc/stamp-vti         |    4 +-
 doc/version.texi      |    4 +-
 src/cmdline.c         |  205 +++++++++---
 src/cmdline.ggo       |   19 +-
 src/cmdline.h         |   14 +-
 src/gengetopt.cc      |    3 +-
 10 files changed, 320 insertions(+), 762 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 0b2e535..7d397c2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -155,7 +155,7 @@ cmdline1.c: sample1.ggo
 
 cmdline2.h: cmdline2.c
 cmdline2.c: sample2.ggo
-	$(PROGNAME) --input=$(srcdir)/sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts --no-handle-help --no-handle-version
+	$(PROGNAME) --input=$(srcdir)/sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unnamed-opts --no-handle-help --no-handle-version
 
 #cmdline1.o: cmdline1.c
 #	$(CC) $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) -c cmdline1.c
diff --git a/doc/README.example b/doc/README.example
index 5e42d11..efa3228 100644
--- a/doc/README.example
+++ b/doc/README.example
@@ -8,7 +8,7 @@ c++ -o main1 main1.cc cmdline1.c
 
 # commands to try the C example: 
 
-gengetopt --input=sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts
+gengetopt --input=sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unnamed-opts
 gcc -o main2 main2.c cmdline2.c -DMY_CMDLINE_PARSER_PACKAGE=\"sample2\" -DMY_CMDLINE_PARSER_VERSION=\"2.0\"
 ./main2 -h
 
diff --git a/doc/gengetopt.info b/doc/gengetopt.info
index cd32b74..55fcf18 100644
--- a/doc/gengetopt.info
+++ b/doc/gengetopt.info
@@ -1,7 +1,7 @@
-This is ../../doc/gengetopt.info, produced by makeinfo version 4.13
-from ../../doc/gengetopt.texinfo.
+This is gengetopt.info, produced by makeinfo version 4.13 from
+gengetopt.texinfo.
 
-This manual is for GNU Gengetopt (version 2.22.6, 25 September 2011), a
+This manual is for GNU Gengetopt (version 2.22.6, 1 October 2011), a
 tool to write command line option parsers for C programs.
 
    Copyright (C) 2001 - 2011 Free Software Foundation, Inc.
@@ -36,8 +36,8 @@ programs.
 
    This file documents GNU Gengetopt version 2.22.6.
 
-   This manual is for GNU Gengetopt (version 2.22.6, 25 September 2011),
-a tool to write command line option parsers for C programs.
+   This manual is for GNU Gengetopt (version 2.22.6, 1 October 2011), a
+tool to write command line option parsers for C programs.
 
    Copyright (C) 2001 - 2011 Free Software Foundation, Inc.
 
@@ -554,44 +554,36 @@ the value `"foobar"' will be selected; instead, passing the value
 
    Here's an example of such a file (the file is called `sample1.ggo')
 
-     # Name of your program
-     package "sample1" # don't use package if you're using automake
-     # Version of your program
-     version "2.0"   # don't use version if you're using automake
-
-     # Options
-     option  "str-opt"         s "A string option, for a filename"
-             string typestr="filename"     optional
-     text "\nA brief text description"
-     text " before the other options.\n"
-     option  "my-opt"          m "Another integer option, \
-     this time the description of the option should be \"quite\" long to \
-     require wrapping... possibly more than one wrapping :-) \
-     especially if I\nrequire a line break"      int     optional
-     option  "int-opt"         i "A int option"         int        yes
-     section "more involved options"
-             sectiondesc="the following options\nare more complex"
-     text ""
-     option  "flag-opt"        - "A flag option"        flag       off
-     option  "funct-opt"       F "A function option"    optional
-         details="\nA function option is basically an option with no argument.\
-       It can be used, e.g., to specify a specific behavior for a program.
-
-     Well, this further explanation is quite useless, but it's only to \
-     show an example of an option with details, \
-     which will be printed only when --detailed-help is given \
-     at the command line."
-     section "last option section"
-     option  "long-opt"        - "A long option"        long       optional
-     option  "def-opt"         - "A string option with default"
-             string default="Hello" optional
-     option  "enum-opt"         - "A string option with list of values"
-             values="foo","bar","hello","bye" default="hello" optional
-     option  "secret"         S "hidden option will not appear in --help"
-             int optional hidden
-     option  "dependant"         D
-             "option that depends on str-opt" int optional dependon="str-opt"
-     text "\nAn ending text."
+   # Name of your program package "sample1" # don't use package if
+you're using automake # Version of your program version "2.0"   # don't
+use version if you're using automake
+
+   # Options option  "str-opt"         s "A string option, for a
+filename"         string typestr="filename"     optional text "\nA
+brief text description" text " before the other options.\n" option
+"my-opt"          m "Another integer option, \ this time the
+description of the option should be \"quite\" long to \ require
+wrapping... possibly more than one wrapping :-) \ especially if
+I\nrequire a line break"      int     optional option  "int-opt"
+i "A int option"         int        yes section "more involved options"
+       sectiondesc="the following options\nare more complex" text ""
+option  "flag-opt"        - "A flag option"        flag       off
+option  "funct-opt"       F "A function option"    optional
+details="\nA function option is basically an option with no argument.\
+It can be used, e.g., to specify a specific behavior for a program.
+
+   Well, this further explanation is quite useless, but it's only to \
+show an example of an option with details, \ which will be printed only
+when -detailed-help is given \ at the command line."  section "last
+option section" option  "long-opt"        - "A long option"        long
+     optional option  "def-opt"         - "A string option with default"
+       string default="Hello" optional option  "enum-opt"         - "A
+string option with list of values"
+values="foo","bar","hello","bye" default="hello" optional option
+"secret"         S "hidden option will not appear in -help"         int
+optional hidden option  "dependant"         D         "option that
+depends on str-opt" int optional dependon="str-opt" text "\nAn ending
+text."
 
    The simplest way to use gengetopt is to pass this file as the
 standard input, i.e.:
@@ -601,9 +593,9 @@ standard input, i.e.:
    By default gengetopt generates `cmdline.h' and `cmdline.c'.
 Otherwise we can specify these names with a command line option:
 
-     gengetopt < sample1.ggo --file-name=cmdline1 --unamed-opts
+     gengetopt < sample1.ggo --file-name=cmdline1 --unnamed-opts
 
-   The option `--unamed-opts' allows the generated command line parser
+   The option `--unnamed-opts' allows the generated command line parser
 to accept also names, without an option (for instance you can pass a
 file name without an option in front of it, and also use wildcards, such
 as `*.c', `foo*.?' and so on).   These are also called _parameters_
@@ -612,238 +604,6 @@ these additional names (default is `FILES').
 
    In `cmdline1.h' you'll find the generated C struct:
 
-     /** @file cmdline1.h
-      *  @brief The header file for the command line option parser
-      *  generated by GNU Gengetopt version 2.22.5
-      *  http://www.gnu.org/software/gengetopt.
-      *  DO NOT modify this file, since it can be overwritten
-      *  @author GNU Gengetopt by Lorenzo Bettini */
-
-     #ifndef CMDLINE1_H
-     #define CMDLINE1_H
-
-     /* If we use autoconf.  */
-     #ifdef HAVE_CONFIG_H
-     #include "config.h"
-     #endif
-
-     #include <stdio.h> /* for FILE */
-
-     #ifdef __cplusplus
-     extern "C" {
-     #endif /* __cplusplus */
-
-     #ifndef CMDLINE_PARSER_PACKAGE
-     /** @brief the program name (used for printing errors) */
-     #define CMDLINE_PARSER_PACKAGE "sample1"
-     #endif
-
-     #ifndef CMDLINE_PARSER_PACKAGE_NAME
-     /** @brief the complete program name (used for help and version) */
-     #define CMDLINE_PARSER_PACKAGE_NAME "sample1"
-     #endif
-
-     #ifndef CMDLINE_PARSER_VERSION
-     /** @brief the program version */
-     #define CMDLINE_PARSER_VERSION "2.0"
-     #endif
-
-     /** @brief Where the command line options are stored */
-     struct gengetopt_args_info
-     {
-       const char *help_help; /**< @brief Print help and exit help description.  */
-       const char *detailed_help_help; /**< @brief Print help, including all details and hidden options, and exit help description.  */
-       const char *full_help_help; /**< @brief Print help, including hidden options, and exit help description.  */
-       const char *version_help; /**< @brief Print version and exit help description.  */
-       char * str_opt_arg;       /**< @brief A string option, for a filename.  */
-       char * str_opt_orig;       /**< @brief A string option, for a filename original value given at command line.  */
-       const char *str_opt_help; /**< @brief A string option, for a filename help description.  */
-       int my_opt_arg;       /**< @brief Another integer option, this time the description of the option should be \"quite\" long to require wrapping... possibly more than one wrapping :-) especially if I
-       require a line break.  */
-       char * my_opt_orig;       /**< @brief Another integer option, this time the description of the option should be \"quite\" long to require wrapping... possibly more than one wrapping :-) especially if I
-       require a line break original value given at command line.  */
-       const char *my_opt_help; /**< @brief Another integer option, this time the description of the option should be \"quite\" long to require wrapping... possibly more than one wrapping :-) especially if I
-       require a line break help description.  */
-       int int_opt_arg;       /**< @brief A int option.  */
-       char * int_opt_orig;       /**< @brief A int option original value given at command line.  */
-       const char *int_opt_help; /**< @brief A int option help description.  */
-       int flag_opt_flag;       /**< @brief A flag option (default=off).  */
-       const char *flag_opt_help; /**< @brief A flag option help description.  */
-       const char *funct_opt_help; /**< @brief A function option help description.  */
-       long long_opt_arg;       /**< @brief A long option.  */
-       char * long_opt_orig;       /**< @brief A long option original value given at command line.  */
-       const char *long_opt_help; /**< @brief A long option help description.  */
-       char * def_opt_arg;       /**< @brief A string option with default (default='Hello').  */
-       char * def_opt_orig;       /**< @brief A string option with default original value given at command line.  */
-       const char *def_opt_help; /**< @brief A string option with default help description.  */
-       char * enum_opt_arg;       /**< @brief A string option with list of values (default='hello').  */
-       char * enum_opt_orig;       /**< @brief A string option with list of values original value given at command line.  */
-       const char *enum_opt_help; /**< @brief A string option with list of values help description.  */
-       int secret_arg;       /**< @brief hidden option will not appear in -help.  */
-       char * secret_orig;       /**< @brief hidden option will not appear in -help original value given at command line.  */
-       const char *secret_help; /**< @brief hidden option will not appear in -help help description.  */
-       int dependant_arg;       /**< @brief option that depends on str-opt.  */
-       char * dependant_orig;       /**< @brief option that depends on str-opt original value given at command line.  */
-       const char *dependant_help; /**< @brief option that depends on str-opt help description.  */
-
-       unsigned int help_given ;       /**< @brief Whether help was given.  */
-       unsigned int detailed_help_given ;       /**< @brief Whether detailed-help was given.  */
-       unsigned int full_help_given ;       /**< @brief Whether full-help was given.  */
-       unsigned int version_given ;       /**< @brief Whether version was given.  */
-       unsigned int str_opt_given ;       /**< @brief Whether str-opt was given.  */
-       unsigned int my_opt_given ;       /**< @brief Whether my-opt was given.  */
-       unsigned int int_opt_given ;       /**< @brief Whether int-opt was given.  */
-       unsigned int flag_opt_given ;       /**< @brief Whether flag-opt was given.  */
-       unsigned int funct_opt_given ;       /**< @brief Whether funct-opt was given.  */
-       unsigned int long_opt_given ;       /**< @brief Whether long-opt was given.  */
-       unsigned int def_opt_given ;       /**< @brief Whether def-opt was given.  */
-       unsigned int enum_opt_given ;       /**< @brief Whether enum-opt was given.  */
-       unsigned int secret_given ;       /**< @brief Whether secret was given.  */
-       unsigned int dependant_given ;       /**< @brief Whether dependant was given.  */
-
-       char **inputs ; /**< @brief unamed options (options without names) */
-       unsigned inputs_num ; /**< @brief unamed options number */
-     } ;
-
-     /** @brief The additional parameters to pass to parser functions */
-     struct cmdline_parser_params
-     {
-       int override; /**< @brief whether to override possibly already present options (default 0) */
-       int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
-       int check_required; /**< @brief whether to check that all required options were provided (default 1) */
-       int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
-       int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
-     } ;
-
-     /** @brief the purpose string of the program */
-     extern const char *gengetopt_args_info_purpose;
-     /** @brief the usage string of the program */
-     extern const char *gengetopt_args_info_usage;
-     /** @brief all the lines making the help output */
-     extern const char *gengetopt_args_info_help[];
-     /** @brief all the lines making the full help output (including hidden options) */
-     extern const char *gengetopt_args_info_full_help[];
-     /** @brief all the lines making the detailed help output (including hidden options and details) */
-     extern const char *gengetopt_args_info_detailed_help[];
-
-     /**
-      * The command line parser
-      * @param argc the number of command line options
-      * @param argv the command line options
-      * @param args_info the structure where option information will be stored
-      * @return 0 if everything went fine, NON 0 if an error took place
-      */
-     int cmdline_parser (int argc, char **argv,
-       struct gengetopt_args_info *args_info);
-
-     /**
-      * The command line parser (version with additional parameters - deprecated)
-      * @param argc the number of command line options
-      * @param argv the command line options
-      * @param args_info the structure where option information will be stored
-      * @param override whether to override possibly already present options
-      * @param initialize whether to initialize the option structure my_args_info
-      * @param check_required whether to check that all required options were provided
-      * @return 0 if everything went fine, NON 0 if an error took place
-      * @deprecated use cmdline_parser_ext() instead
-      */
-     int cmdline_parser2 (int argc, char **argv,
-       struct gengetopt_args_info *args_info,
-       int override, int initialize, int check_required);
-
-     /**
-      * The command line parser (version with additional parameters)
-      * @param argc the number of command line options
-      * @param argv the command line options
-      * @param args_info the structure where option information will be stored
-      * @param params additional parameters for the parser
-      * @return 0 if everything went fine, NON 0 if an error took place
-      */
-     int cmdline_parser_ext (int argc, char **argv,
-       struct gengetopt_args_info *args_info,
-       struct cmdline_parser_params *params);
-
-     /**
-      * Save the contents of the option struct into an already open FILE stream.
-      * @param outfile the stream where to dump options
-      * @param args_info the option struct to dump
-      * @return 0 if everything went fine, NON 0 if an error took place
-      */
-     int cmdline_parser_dump(FILE *outfile,
-       struct gengetopt_args_info *args_info);
-
-     /**
-      * Save the contents of the option struct into a (text) file.
-      * This file can be read by the config file parser (if generated by gengetopt)
-      * @param filename the file where to save
-      * @param args_info the option struct to save
-      * @return 0 if everything went fine, NON 0 if an error took place
-      */
-     int cmdline_parser_file_save(const char *filename,
-       struct gengetopt_args_info *args_info);
-
-     /**
-      * Print the help
-      */
-     void cmdline_parser_print_help(void);
-     /**
-      * Print the full help (including hidden options)
-      */
-     void cmdline_parser_print_full_help(void);
-     /**
-      * Print the detailed help (including hidden options and details)
-      */
-     void cmdline_parser_print_detailed_help(void);
-     /**
-      * Print the version
-      */
-     void cmdline_parser_print_version(void);
-
-     /**
-      * Initializes all the fields a cmdline_parser_params structure
-      * to their default values
-      * @param params the structure to initialize
-      */
-     void cmdline_parser_params_init(struct cmdline_parser_params *params);
-
-     /**
-      * Allocates dynamically a cmdline_parser_params structure and initializes
-      * all its fields to their default values
-      * @return the created and initialized cmdline_parser_params structure
-      */
-     struct cmdline_parser_params *cmdline_parser_params_create(void);
-
-     /**
-      * Initializes the passed gengetopt_args_info structure's fields
-      * (also set default values for options that have a default)
-      * @param args_info the structure to initialize
-      */
-     void cmdline_parser_init (struct gengetopt_args_info *args_info);
-     /**
-      * Deallocates the string fields of the gengetopt_args_info structure
-      * (but does not deallocate the structure itself)
-      * @param args_info the structure to deallocate
-      */
-     void cmdline_parser_free (struct gengetopt_args_info *args_info);
-
-     /**
-      * Checks that all the required options were specified
-      * @param args_info the structure to check
-      * @param prog_name the name of the program that will be used to print
-      *   possible errors
-      * @return
-      */
-     int cmdline_parser_required (struct gengetopt_args_info *args_info,
-       const char *prog_name);
-
-     extern const char *cmdline_parser_enum_opt_values[];  /**< @brief Possible values for enum-opt. */
-
-
-     #ifdef __cplusplus
-     }
-     #endif /* __cplusplus */
-     #endif /* CMDLINE1_H */
-
    First of all, notice that the `argv' parameter (typically
 corresponding to the homonimous argument of your program's `main'
 function) is declared as `char **' and not as `char *const *'(17).
@@ -941,73 +701,6 @@ file name.
 
    And here's how these functions can be used inside the main program:
 
-     /* main1.cc */
-     /* we try to use gengetopt generated file in a C++ program */
-     /* we don't use autoconf and automake vars */
-
-     #include <iostream>
-     #include "stdlib.h"
-
-     #include "cmdline1.h"
-
-     using std::cout;
-     using std::endl;
-
-     int
-     main (int argc, char **argv)
-     {
-       gengetopt_args_info args_info;
-
-       cout << "This one is from a C++ program" << endl ;
-       cout << "Try to launch me with some options" << endl ;
-       cout << "(type sample1 --help for the complete list)" << endl ;
-       cout << "For example: ./sample1 *.* --funct-opt" << endl ;
-
-       /* let's call our cmdline parser */
-       if (cmdline_parser (argc, argv, &args_info) != 0)
-         exit(1) ;
-
-       cout << "Here are the options you passed..." << endl;
-
-       for ( unsigned i = 0 ; i < args_info.inputs_num ; ++i )
-         cout << "file: " << args_info.inputs[i] << endl ;
-
-       if ( args_info.funct_opt_given )
-         cout << "You chose --funct-opt or -F." << endl ;
-
-       if ( args_info.str_opt_given )
-         cout << "You inserted " << args_info.str_opt_arg << " for " <<
-           "--str-opt option." << endl ;
-
-       if ( args_info.int_opt_given )
-         cout << "This is the integer you input: " <<
-           args_info.int_opt_arg << "." << endl;
-
-       if (args_info.flag_opt_given)
-         cout << "The flag option was given!" << endl;
-
-       cout << "The flag is " << ( args_info.flag_opt_flag ? "on" : "off" ) <<
-         "." << endl ;
-
-       if (args_info.enum_opt_given) {
-         cout << "enum-opt value: " << args_info.enum_opt_arg << endl;
-         cout << "enum-opt (original specified) value: "
-             << args_info.enum_opt_orig << endl;
-       }
-
-       if (args_info.secret_given)
-         cout << "Secret option was specified: " << args_info.secret_arg
-             << endl;
-
-       cout << args_info.def_opt_arg << "! ";
-
-       cout << "Have a nice day! :-)" << endl ;
-
-       cmdline_parser_free (&args_info); /* release allocated memory */
-
-       return 0;
-     }
-
    Now you can compile `main1.cc' and the `cmdline1.c' generated by
 gengetopt and link all together to obtain `sample1' executable:
 
@@ -1272,6 +965,7 @@ This is the output of `gengetopt --help':
        -h, --help                    Print help and exit
            --detailed-help           Print help, including all details and hidden
                                        options, and exit
+           --full-help               Print help, including hidden options, and exit
        -V, --version                 Print version and exit
 
      Main options:
@@ -1360,7 +1054,7 @@ This is the output of `gengetopt --help':
      Otherwise, options are considered mandatory (if not explicitly
      specified otherwise).
 
-`--unamed-opts'
+`--unnamed-opts'
      the program will accept also options without a name, which, in most
      case, means that we can pass many file names to the program (see
      the example in *note Basic Usage::, where we call `sample1 *.h').
@@ -1746,34 +1440,6 @@ options.
 
    For instance, let us consider the file `test_modes_cmd.ggo':
 
-     package "test_modes"
-     version "1.0"
-
-     section "some non mode options"
-
-     option "no-mode" N "a generic option not beloging to any mode" optional
-     option "no-mode2" - "another generic option not beloging to any mode" string optional
-
-     section "some modes just for testing"
-
-     defmode "mode 2"
-     defmode "my mode"
-     defmode "mode1" modedesc="any option of this mode is in contrast with any \
-     option of the other mode\nNotice that this description is quite long so \
-     it may spawn many lines...              \
-     fortunately gengetopt will wrap it for you :-)"
-
-     modeoption "opta" a "string a" multiple mode="mode1" optional
-     modeoption "optA" A "string A" string argoptional mode="mode1" required
-     modeoption "optAmul" M "string M"
-             argoptional string mode="mode1" multiple optional
-     modeoption "optb" b "string b" mode="mode1" optional
-
-     modeoption "optc" - "string c" mode="mode 2" optional
-     modeoption "optd" d "string d" mode="mode 2" required
-
-     modeoption "mopt" m "option of my mode" int optional mode="my mode" optional
-
 Now, we use the program `test_modes' (that uses the generated parser
 for the input file above) to demonstrate how the parser generated by
 gengetopt perform checks on mode options.
@@ -2008,94 +1674,6 @@ other configuration files) in a configuration file, by using the
    For instance here's a program that uses this feature (this is the
 test `test_conf_parser'):
 
-     /* test_conf_parser.c test */
-
-     /* test all kinds of options and the conf file parser */
-
-     #include <stdlib.h>
-     #include <stdio.h>
-
-     #include "test_conf_parser_cmd.h"
-
-     static struct my_args_info args_info;
-
-     int
-     main (int argc, char **argv)
-     {
-       unsigned int i;
-       int result = 0;
-
-       struct test_conf_parser_cmd_parser_params *params;
-
-       /* initialize the parameters structure */
-       params = test_conf_parser_cmd_parser_params_create();
-
-       /* call the command line parser */
-       if (test_conf_parser_cmd_parser (argc, argv, &args_info) != 0) {
-         result = 1;
-         goto stop;
-       }
-
-       /*
-          override command line options,
-          but do not initialize args_info, check for required options.
-          NOTICE: we must NOT skip the 0 assignment to initialize,
-          since its default value is 1 and override defaults to 0
-          while check_required is already set to its default value, 1
-       */
-       params->initialize = 0;
-       params->override = 1;
-
-       /* call the config file parser */
-       if (test_conf_parser_cmd_parser_config_file
-           (args_info.conf_file_arg, &args_info, params) != 0)
-         {
-           result = 1;
-           goto stop;
-         }
-
-       printf ("value of required: %s\n", args_info.required_arg);
-       printf ("value of string: %s\n", args_info.string_arg);
-       printf ("value of no-short_given: %d\n", args_info.no_short_given);
-       printf ("value of int: %d\n", args_info.int_arg);
-       printf ("value of float: %f\n", args_info.float_arg);
-
-       printf ("value of multi-string_given: %d\n", args_info.multi_string_given);
-       for (i = 0; i < args_info.multi_string_given; i++)
-         printf ("  value of multi-string: %s\n", args_info.multi_string_arg [i]);
-
-       printf ("value of multi-string-def_given: %d\n",
-               args_info.multi_string_def_given);
-       for (i = 0; i < args_info.multi_string_def_given; ++i)
-         printf ("  value of multi-string-def: %s\n",
-                 args_info.multi_string_def_arg [i]);
-       if (!args_info.multi_string_def_given && args_info.multi_string_def_arg [0])
-         printf ("default value of multi-string-def: %s\n",
-                 args_info.multi_string_def_arg [0]);
-
-       printf ("value of opta: %s\n", args_info.opta_arg);
-
-       printf ("noarg given %d times\n", args_info.noarg_given);
-       printf ("noarg_noshort given %d times\n", args_info.noarg_noshort_given);
-
-       printf ("opt-arg given: %d\n", args_info.opt_arg_given);
-       printf ("opt-arg value: %s\n", (args_info.opt_arg_arg ? args_info.opt_arg_arg : "not given"));
-
-       if (args_info.file_save_given) {
-         if (test_conf_parser_cmd_parser_file_save (args_info.file_save_arg, &args_info) == EXIT_FAILURE)
-           result = 1;
-         else
-           printf ("saved configuration file %s\n", args_info.file_save_arg);
-       }
-
-      stop:
-       /* deallocate structures */
-       test_conf_parser_cmd_parser_free (&args_info);
-       free (params);
-
-       return result;
-     }
-
    So if we use the following config file
 
      # required option
@@ -2127,63 +1705,6 @@ parser: first call the configuration file parser and then the command
 line parser (the command line options will override the configuration
 file options):
 
-     /* test_conf_parser_ov2.c test */
-
-     /* test all kinds of options and the conf file parser */
-     /* differently from test_conf_parser_ov.c, first scan the conf file and
-        then the command line */
-
-     #include <stdlib.h>
-     #include <stdio.h>
-
-     #include "test_conf_parser_cmd.h"
-
-     static struct my_args_info args_info;
-
-     int
-     main (int argc, char **argv)
-     {
-       struct test_conf_parser_cmd_parser_params *params;
-
-       /* initialize the parameters structure */
-       params = test_conf_parser_cmd_parser_params_create();
-
-       /*
-          initialize args_info, but don't check for required options
-          NOTICE: the other fields are initialized to their default values
-       */
-       params->check_required = 0;
-
-       /* call the config file parser */
-       if (test_conf_parser_cmd_parser_config_file
-           ("../../tests/test_conf2.conf", &args_info, params) != 0)
-         exit(1);
-
-       /*
-          override config file options,
-          do not initialize args_info, check for required options.
-       */
-       params->initialize = 0;
-       params->override = 1;
-       params->check_required = 1;
-
-       /* call the command line parser */
-       if (test_conf_parser_cmd_parser_ext (argc, argv, &args_info, params) != 0)
-         exit(1) ;
-
-       printf ("value of required: %s\n", args_info.required_arg);
-       printf ("value of string: %s\n", args_info.string_arg);
-       printf ("value of no-short_given: %d\n", args_info.no_short_given);
-       printf ("value of int: %d\n", args_info.int_arg);
-       printf ("value of float: %f\n", args_info.float_arg);
-
-       /* release memory */
-       test_conf_parser_cmd_parser_free (&args_info);
-       free (params);
-
-       return 0;
-     }
-
 This is an invocation and its results:
 
      ./test_conf_parser_ov2 -r "bar" --float 2.14 -i 100
@@ -2264,32 +1785,6 @@ Then the command line options can be collected like that
 
 Then if this program is called with the following command line options
 
-     /* test options that can be given more than once */
-
-     #include <stdlib.h>
-     #include <stdio.h>
-
-     #include "test_multiple_cmd.h"
-
-     static struct gengetopt_args_info args_info;
-
-     int
-     main (int argc, char **argv)
-     {
-       int i = 0;
-
-       if (test_multiple_cmd_parser (argc, argv, &args_info) != 0)
-         exit(1) ;
-
-       for (i = 0; i < args_info.string_given; ++i)
-         printf ("passed string: %s\n", args_info.string_arg[i]);
-
-       for (i = 0; i < args_info.int_given; ++i)
-         printf ("passed int: %d\n", args_info.int_arg[i]);
-
-       return 0;
-     }
-
 The output of the program will be
 
      passed string: world
@@ -2430,60 +1925,6 @@ and the second one is:
    These last two files are processed with gengetopt using the
 `--string-parser'.  Let's put everything together in this main file:
 
-     #include <stdio.h>
-     #include <stdlib.h>
-
-     #include "test_main_cmdline_cmd.h"
-     #include "test_first_cmdline_cmd.h"
-     #include "test_second_cmdline_cmd.h"
-
-     int
-     main(int argc, char **argv)
-     {
-       struct gengetopt_args_info main_args_info;
-       struct test_first_cmdline_cmd_struct first_args_info;
-       struct test_second_cmdline_cmd_struct second_args_info;
-       int exit_code = 0;
-       unsigned int i, j;
-
-       if (test_main_cmdline_cmd_parser (argc, argv, &main_args_info) != 0) {
-         exit_code = 1;
-         return exit_code;
-       }
-
-       for (j = 0; j < main_args_info.second_cmd_given; ++j) {
-         printf("second cmdline: %s\n", main_args_info.second_cmd_arg[j]);
-         if (test_second_cmdline_cmd_parser_string
-            (main_args_info.second_cmd_arg[j], &second_args_info, argv[0]) == 0) {
-           if (second_args_info.option_a_given)
-            printf("  --option-a: %s\n", second_args_info.option_a_arg);
-           if (second_args_info.option_b_given)
-            printf("  --option-b: %s\n", second_args_info.option_b_arg);
-           for (i = 0; i < second_args_info.my_multi_given; ++i)
-            printf("  --my-multi: %s\n", second_args_info.my_multi_arg[i]);
-
-           test_second_cmdline_cmd_parser_free (&second_args_info);
-         }
-       }
-
-       for (j = 0; j < main_args_info.first_cmd_given; ++j) {
-         printf("first cmdline: %s\n", main_args_info.first_cmd_arg[j]);
-         if (test_first_cmdline_cmd_parser_string
-            (main_args_info.first_cmd_arg[j], &first_args_info, argv[0]) == 0) {
-           if (first_args_info.option_a_given)
-            printf("  --option-a: %d\n", first_args_info.option_a_arg);
-           for (i = 0; i < first_args_info.multi_given; ++i)
-            printf("  --multi: %s\n", first_args_info.multi_arg[i]);
-
-           test_first_cmdline_cmd_parser_free (&first_args_info);
-         }
-       }
-
-       test_main_cmdline_cmd_parser_free (&main_args_info);
-
-       return exit_code;
-     }
-
    Notice that in the `for' loops we always free the elements of the
 argument structures in order to avoid memory leaks.
 
@@ -2857,34 +2298,34 @@ Index
  [index ]
 * Menu:
 
-* --arg-struct-name:                     Invoking gengetopt.  (line  93)
-* --conf-parser:                         Invoking gengetopt.  (line 166)
-* --default-optional <1>:                Invoking gengetopt.  (line 101)
+* --arg-struct-name:                     Invoking gengetopt.  (line  94)
+* --conf-parser:                         Invoking gengetopt.  (line 167)
+* --default-optional <1>:                Invoking gengetopt.  (line 102)
 * --default-optional:                    Basic Usage.         (line 135)
 * --detailed-help:                       Basic Usage.         (line  98)
 * --full-help:                           Basic Usage.         (line 169)
-* --func-name:                           Invoking gengetopt.  (line  80)
-* --gen-version:                         Invoking gengetopt.  (line 161)
-* --header-output-dir:                   Invoking gengetopt.  (line  89)
+* --func-name:                           Invoking gengetopt.  (line  81)
+* --gen-version:                         Invoking gengetopt.  (line 162)
+* --header-output-dir:                   Invoking gengetopt.  (line  90)
 * --include-getopt <1>:                  Include the getopt_long code into the parser.
                                                               (line  11)
-* --include-getopt:                      Invoking gengetopt.  (line 172)
-* --long-help:                           Invoking gengetopt.  (line  97)
-* --no-handle-error:                     Invoking gengetopt.  (line 149)
-* --no-handle-help:                      Invoking gengetopt.  (line 115)
-* --no-handle-version:                   Invoking gengetopt.  (line 115)
-* --no-help:                             Invoking gengetopt.  (line 135)
-* --no-version:                          Invoking gengetopt.  (line 135)
-* --output-dir:                          Invoking gengetopt.  (line  83)
-* --show-full-help:                      Invoking gengetopt.  (line 181)
-* --show-help:                           Invoking gengetopt.  (line 181)
-* --show-required:                       Invoking gengetopt.  (line 156)
-* --show-version:                        Invoking gengetopt.  (line 181)
-* --src-output-dir:                      Invoking gengetopt.  (line  89)
-* --string-parser:                       Invoking gengetopt.  (line 169)
-* --unamed-opts:                         Invoking gengetopt.  (line 107)
+* --include-getopt:                      Invoking gengetopt.  (line 173)
+* --long-help:                           Invoking gengetopt.  (line  98)
+* --no-handle-error:                     Invoking gengetopt.  (line 150)
+* --no-handle-help:                      Invoking gengetopt.  (line 116)
+* --no-handle-version:                   Invoking gengetopt.  (line 116)
+* --no-help:                             Invoking gengetopt.  (line 136)
+* --no-version:                          Invoking gengetopt.  (line 136)
+* --output-dir:                          Invoking gengetopt.  (line  84)
+* --show-full-help:                      Invoking gengetopt.  (line 182)
+* --show-help:                           Invoking gengetopt.  (line 182)
+* --show-required:                       Invoking gengetopt.  (line 157)
+* --show-version:                        Invoking gengetopt.  (line 182)
+* --src-output-dir:                      Invoking gengetopt.  (line  90)
+* --string-parser:                       Invoking gengetopt.  (line 170)
+* --unnamed-opts:                        Invoking gengetopt.  (line 108)
 * -C,--conf-parser:                      Configuration files. (line   6)
-* -h,--detailed-help:                    Basic Usage.         (line 857)
+* -h,--detailed-help:                    Basic Usage.         (line 550)
 * -h,--help:                             Basic Usage.         (line 221)
 * -S,--string-parser:                    String Parsers and Multiple Parsers.
                                                               (line  21)
@@ -2896,7 +2337,7 @@ Index
 * args:                                  Basic Usage.         (line  67)
 * argtype:                               Basic Usage.         (line 104)
 * argument, defined:                     Terminology.         (line   6)
-* argv:                                  Basic Usage.         (line 564)
+* argv:                                  Basic Usage.         (line 324)
 * Audience:                              Audience.            (line   6)
 * autoconf <1>:                          Use getopt_long sources.
                                                               (line  11)
@@ -2953,7 +2394,7 @@ Index
 * multiple parsers:                      String Parsers and Multiple Parsers.
                                                               (line   6)
 * on/off:                                Basic Usage.         (line 179)
-* option without name:                   Basic Usage.         (line 323)
+* option without name:                   Basic Usage.         (line 315)
 * option, defined:                       Terminology.         (line   6)
 * optional:                              Basic Usage.         (line 135)
 * override:                              Parser function additional parameters.
@@ -2963,7 +2404,7 @@ Index
 * PACKAGE:                               Audience.            (line  36)
 * PACKAGE_NAME <1>:                      Basic Usage.         (line  39)
 * PACKAGE_NAME:                          Audience.            (line  36)
-* parameter:                             Basic Usage.         (line 323)
+* parameter:                             Basic Usage.         (line 315)
 * parameter, defined:                    Terminology.         (line   6)
 * parameters:                            Parser function additional parameters.
                                                               (line   6)
@@ -2999,72 +2440,72 @@ Index
 
 
 Tag Table:
-Node: Top1106
-Node: Audience3339
-Node: Copying5110
-Node: Installation5919
-Ref: Installation-Footnote-110746
-Ref: Installation-Footnote-210862
-Ref: Installation-Footnote-310909
-Ref: Installation-Footnote-410956
-Ref: Installation-Footnote-511002
-Node: Basic Usage11047
-Ref: hidden17892
-Ref: fullhelp17892
-Ref: addedoptions19797
-Ref: showrequired46479
-Ref: helpoutput46729
-Ref: Basic Usage-Footnote-152385
-Ref: Basic Usage-Footnote-252413
-Ref: Basic Usage-Footnote-352441
-Ref: Basic Usage-Footnote-452468
-Ref: Basic Usage-Footnote-552496
-Ref: Basic Usage-Footnote-652549
-Ref: Basic Usage-Footnote-752577
-Ref: Basic Usage-Footnote-852605
-Ref: Basic Usage-Footnote-952633
-Ref: Basic Usage-Footnote-1052661
-Ref: Basic Usage-Footnote-1152778
-Ref: Basic Usage-Footnote-1252807
-Ref: Basic Usage-Footnote-1352928
-Ref: Basic Usage-Footnote-1453031
-Ref: Basic Usage-Footnote-1553060
-Ref: Basic Usage-Footnote-1653089
-Ref: Basic Usage-Footnote-1753118
-Ref: Basic Usage-Footnote-1853172
-Ref: Basic Usage-Footnote-1953241
-Ref: Basic Usage-Footnote-2053361
-Ref: Basic Usage-Footnote-2153426
-Ref: Basic Usage-Footnote-2253510
-Ref: Basic Usage-Footnote-2353569
-Node: Invoking gengetopt53628
-Ref: Invoking gengetopt-Footnote-163555
-Ref: Invoking gengetopt-Footnote-263583
-Ref: Invoking gengetopt-Footnote-363613
-Node: Terminology63641
-Node: Options with enumerated values68531
-Node: Group options71352
-Node: Mode options73406
-Node: Parser function additional parameters78775
-Ref: Parser function additional parameters-Footnote-181890
-Ref: Parser function additional parameters-Footnote-281918
-Ref: Parser function additional parameters-Footnote-381953
-Node: Configuration files82710
-Ref: Configuration files-Footnote-193085
-Ref: Configuration files-Footnote-293276
-Node: Multiple Options93442
-Node: String Parsers and Multiple Parsers97049
-Ref: String Parsers and Multiple Parsers-Footnote-1104749
-Node: No getopt_long104922
-Node: Include the getopt_long code into the parser105656
-Node: Use automake/autoconf106925
-Node: Use Gnulib107797
-Ref: Use Gnulib-Footnote-1111928
-Node: Use getopt_long sources111973
-Node: Bugs114158
-Node: Getopt and subsequent calls114956
-Ref: Getopt and subsequent calls-Footnote-1116883
-Node: Mailing Lists117129
-Node: Index117929
+Node: Top1083
+Node: Audience3313
+Node: Copying5084
+Node: Installation5893
+Ref: Installation-Footnote-110720
+Ref: Installation-Footnote-210836
+Ref: Installation-Footnote-310883
+Ref: Installation-Footnote-410930
+Ref: Installation-Footnote-510976
+Node: Basic Usage11021
+Ref: hidden17866
+Ref: fullhelp17866
+Ref: addedoptions19771
+Ref: showrequired32236
+Ref: helpoutput32486
+Ref: Basic Usage-Footnote-138142
+Ref: Basic Usage-Footnote-238170
+Ref: Basic Usage-Footnote-338198
+Ref: Basic Usage-Footnote-438225
+Ref: Basic Usage-Footnote-538253
+Ref: Basic Usage-Footnote-638306
+Ref: Basic Usage-Footnote-738334
+Ref: Basic Usage-Footnote-838362
+Ref: Basic Usage-Footnote-938390
+Ref: Basic Usage-Footnote-1038418
+Ref: Basic Usage-Footnote-1138535
+Ref: Basic Usage-Footnote-1238564
+Ref: Basic Usage-Footnote-1338685
+Ref: Basic Usage-Footnote-1438788
+Ref: Basic Usage-Footnote-1538817
+Ref: Basic Usage-Footnote-1638846
+Ref: Basic Usage-Footnote-1738875
+Ref: Basic Usage-Footnote-1838929
+Ref: Basic Usage-Footnote-1938998
+Ref: Basic Usage-Footnote-2039118
+Ref: Basic Usage-Footnote-2139183
+Ref: Basic Usage-Footnote-2239267
+Ref: Basic Usage-Footnote-2339326
+Node: Invoking gengetopt39385
+Ref: Invoking gengetopt-Footnote-149397
+Ref: Invoking gengetopt-Footnote-249425
+Ref: Invoking gengetopt-Footnote-349455
+Node: Terminology49483
+Node: Options with enumerated values54373
+Node: Group options57194
+Node: Mode options59248
+Node: Parser function additional parameters63507
+Ref: Parser function additional parameters-Footnote-166622
+Ref: Parser function additional parameters-Footnote-266650
+Ref: Parser function additional parameters-Footnote-366685
+Node: Configuration files67442
+Ref: Configuration files-Footnote-172942
+Ref: Configuration files-Footnote-273133
+Node: Multiple Options73299
+Node: String Parsers and Multiple Parsers76300
+Ref: String Parsers and Multiple Parsers-Footnote-181969
+Node: No getopt_long82142
+Node: Include the getopt_long code into the parser82876
+Node: Use automake/autoconf84145
+Node: Use Gnulib85017
+Ref: Use Gnulib-Footnote-189148
+Node: Use getopt_long sources89193
+Node: Bugs91378
+Node: Getopt and subsequent calls92176
+Ref: Getopt and subsequent calls-Footnote-194103
+Node: Mailing Lists94349
+Node: Index95149
 
 End Tag Table
diff --git a/doc/gengetopt.texinfo b/doc/gengetopt.texinfo
index 29e360f..1a0270d 100644
--- a/doc/gengetopt.texinfo
+++ b/doc/gengetopt.texinfo
@@ -714,12 +714,12 @@ By default gengetopt generates @file{cmdline.h} and @file{cmdline.c}.  Otherwise
 can specify these names with a command line option:
 
 @example
-gengetopt < sample1.ggo --file-name=cmdline1 --unamed-opts
+gengetopt < sample1.ggo --file-name=cmdline1 --unnamed-opts
 @end example
 
 @cindex parameter
 @cindex option without name
-The option @code{--unamed-opts} allows the generated command line parser
+The option @code{--unnamed-opts} allows the generated command line parser
 to accept also names, without an option (for instance you can pass a
 file name without an option in front of it, and also use wildcards, such
 as @code{*.c}, @code{foo*.?} and so on).   These are also called
@@ -1016,8 +1016,8 @@ If this command line option is given, by default, options are considered
 optional (if not explicitly specified otherwise).  Otherwise, options
 are considered mandatory (if not explicitly specified otherwise).
  
-@item --unamed-opts
-@cindex @code{--unamed-opts}
+@item --unnamed-opts
+@cindex @code{--unnamed-opts}
 the program will accept also options without a name, which, in most
 case, means that we can pass many file names to the program (see the
 example in @ref{Basic Usage}, where we call @code{sample1 *.h}). You can
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 6f94819..61feb1c 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 25 September 2011
-@set UPDATED-MONTH September 2011
+@set UPDATED 1 October 2011
+@set UPDATED-MONTH October 2011
 @set EDITION 2.22.6
 @set VERSION 2.22.6
diff --git a/doc/version.texi b/doc/version.texi
index 6f94819..61feb1c 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 25 September 2011
-@set UPDATED-MONTH September 2011
+@set UPDATED 1 October 2011
+@set UPDATED-MONTH October 2011
 @set EDITION 2.22.6
 @set VERSION 2.22.6
diff --git a/src/cmdline.c b/src/cmdline.c
index 6505068..b834156 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -1,7 +1,7 @@
 /*
-  File autogenerated by gengetopt version 2.22.5
+  File autogenerated by gengetopt version 2.22.6
   generated with the following command:
-  ../src/gengetopt --input=../../src/cmdline.ggo --output-dir=../../src --no-handle-version --no-handle-help --no-handle-error --string-parser
+  ../src/gengetopt --input=cmdline.ggo --output-dir=. --no-handle-version --no-handle-help --no-handle-error --string-parser
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
@@ -34,6 +34,7 @@ const char *gengetopt_args_info_description = "";
 const char *gengetopt_args_info_detailed_help[] = {
   "  -h, --help                    Print help and exit",
   "      --detailed-help           Print help, including all details and hidden \n                                  options, and exit",
+  "      --full-help               Print help, including hidden options, and exit",
   "  -V, --version                 Print version and exit",
   "\nMain options:",
   "",
@@ -51,6 +52,7 @@ const char *gengetopt_args_info_detailed_help[] = {
   "  \n  The usage line will print all the options, e.g.,\n\n  sample1 -iINT|--int-opt=INT [-h|--help]\n",
   "      --default-optional        by default, an option is considered optional if \n                                  not specified otherwise",
   "  -u, --unamed-opts[=STRING]    accept options without names (e.g., file names) \n                                   (default=`FILES')",
+  "      --unnamed-opts[=STRING]   synonym for --unnamed-opts, accepted for \n                                  backwards compatibility  (default=`FILES')",
   "\nThe parser generated is thought to be used to parse the command line arguments. \nHowever, you can also generate parsers for configuration files, or strings that \ncontain the arguments to parse, by using the following two options.\n",
   "  -C, --conf-parser             generate a config file parser",
   "  -S, --string-parser           generate a string parser (the string contains \n                                  the command line)",
@@ -77,6 +79,53 @@ const char *gengetopt_args_info_detailed_help[] = {
   "\nPlease refer to the info manual for further explanations.",
     0
 };
+static void
+init_full_help_array(void)
+{
+  gengetopt_args_info_full_help[0] = gengetopt_args_info_detailed_help[0];
+  gengetopt_args_info_full_help[1] = gengetopt_args_info_detailed_help[1];
+  gengetopt_args_info_full_help[2] = gengetopt_args_info_detailed_help[2];
+  gengetopt_args_info_full_help[3] = gengetopt_args_info_detailed_help[3];
+  gengetopt_args_info_full_help[4] = gengetopt_args_info_detailed_help[4];
+  gengetopt_args_info_full_help[5] = gengetopt_args_info_detailed_help[5];
+  gengetopt_args_info_full_help[6] = gengetopt_args_info_detailed_help[6];
+  gengetopt_args_info_full_help[7] = gengetopt_args_info_detailed_help[7];
+  gengetopt_args_info_full_help[8] = gengetopt_args_info_detailed_help[8];
+  gengetopt_args_info_full_help[9] = gengetopt_args_info_detailed_help[9];
+  gengetopt_args_info_full_help[10] = gengetopt_args_info_detailed_help[10];
+  gengetopt_args_info_full_help[11] = gengetopt_args_info_detailed_help[12];
+  gengetopt_args_info_full_help[12] = gengetopt_args_info_detailed_help[13];
+  gengetopt_args_info_full_help[13] = gengetopt_args_info_detailed_help[14];
+  gengetopt_args_info_full_help[14] = gengetopt_args_info_detailed_help[15];
+  gengetopt_args_info_full_help[15] = gengetopt_args_info_detailed_help[16];
+  gengetopt_args_info_full_help[16] = gengetopt_args_info_detailed_help[18];
+  gengetopt_args_info_full_help[17] = gengetopt_args_info_detailed_help[19];
+  gengetopt_args_info_full_help[18] = gengetopt_args_info_detailed_help[20];
+  gengetopt_args_info_full_help[19] = gengetopt_args_info_detailed_help[21];
+  gengetopt_args_info_full_help[20] = gengetopt_args_info_detailed_help[22];
+  gengetopt_args_info_full_help[21] = gengetopt_args_info_detailed_help[23];
+  gengetopt_args_info_full_help[22] = gengetopt_args_info_detailed_help[24];
+  gengetopt_args_info_full_help[23] = gengetopt_args_info_detailed_help[25];
+  gengetopt_args_info_full_help[24] = gengetopt_args_info_detailed_help[26];
+  gengetopt_args_info_full_help[25] = gengetopt_args_info_detailed_help[27];
+  gengetopt_args_info_full_help[26] = gengetopt_args_info_detailed_help[29];
+  gengetopt_args_info_full_help[27] = gengetopt_args_info_detailed_help[31];
+  gengetopt_args_info_full_help[28] = gengetopt_args_info_detailed_help[32];
+  gengetopt_args_info_full_help[29] = gengetopt_args_info_detailed_help[34];
+  gengetopt_args_info_full_help[30] = gengetopt_args_info_detailed_help[36];
+  gengetopt_args_info_full_help[31] = gengetopt_args_info_detailed_help[37];
+  gengetopt_args_info_full_help[32] = gengetopt_args_info_detailed_help[38];
+  gengetopt_args_info_full_help[33] = gengetopt_args_info_detailed_help[39];
+  gengetopt_args_info_full_help[34] = gengetopt_args_info_detailed_help[40];
+  gengetopt_args_info_full_help[35] = gengetopt_args_info_detailed_help[41];
+  gengetopt_args_info_full_help[36] = gengetopt_args_info_detailed_help[42];
+  gengetopt_args_info_full_help[37] = gengetopt_args_info_detailed_help[43];
+  gengetopt_args_info_full_help[38] = gengetopt_args_info_detailed_help[44];
+  gengetopt_args_info_full_help[39] = 0; 
+  
+}
+
+const char *gengetopt_args_info_full_help[40];
 
 static void
 init_help_array(void)
@@ -91,38 +140,39 @@ init_help_array(void)
   gengetopt_args_info_help[7] = gengetopt_args_info_detailed_help[7];
   gengetopt_args_info_help[8] = gengetopt_args_info_detailed_help[8];
   gengetopt_args_info_help[9] = gengetopt_args_info_detailed_help[9];
-  gengetopt_args_info_help[10] = gengetopt_args_info_detailed_help[11];
+  gengetopt_args_info_help[10] = gengetopt_args_info_detailed_help[10];
   gengetopt_args_info_help[11] = gengetopt_args_info_detailed_help[12];
   gengetopt_args_info_help[12] = gengetopt_args_info_detailed_help[13];
   gengetopt_args_info_help[13] = gengetopt_args_info_detailed_help[14];
   gengetopt_args_info_help[14] = gengetopt_args_info_detailed_help[15];
-  gengetopt_args_info_help[15] = gengetopt_args_info_detailed_help[17];
+  gengetopt_args_info_help[15] = gengetopt_args_info_detailed_help[16];
   gengetopt_args_info_help[16] = gengetopt_args_info_detailed_help[18];
   gengetopt_args_info_help[17] = gengetopt_args_info_detailed_help[19];
-  gengetopt_args_info_help[18] = gengetopt_args_info_detailed_help[20];
-  gengetopt_args_info_help[19] = gengetopt_args_info_detailed_help[21];
-  gengetopt_args_info_help[20] = gengetopt_args_info_detailed_help[22];
-  gengetopt_args_info_help[21] = gengetopt_args_info_detailed_help[23];
-  gengetopt_args_info_help[22] = gengetopt_args_info_detailed_help[24];
-  gengetopt_args_info_help[23] = gengetopt_args_info_detailed_help[25];
+  gengetopt_args_info_help[18] = gengetopt_args_info_detailed_help[21];
+  gengetopt_args_info_help[19] = gengetopt_args_info_detailed_help[22];
+  gengetopt_args_info_help[20] = gengetopt_args_info_detailed_help[23];
+  gengetopt_args_info_help[21] = gengetopt_args_info_detailed_help[24];
+  gengetopt_args_info_help[22] = gengetopt_args_info_detailed_help[25];
+  gengetopt_args_info_help[23] = gengetopt_args_info_detailed_help[26];
   gengetopt_args_info_help[24] = gengetopt_args_info_detailed_help[27];
   gengetopt_args_info_help[25] = gengetopt_args_info_detailed_help[29];
-  gengetopt_args_info_help[26] = gengetopt_args_info_detailed_help[30];
+  gengetopt_args_info_help[26] = gengetopt_args_info_detailed_help[31];
   gengetopt_args_info_help[27] = gengetopt_args_info_detailed_help[32];
   gengetopt_args_info_help[28] = gengetopt_args_info_detailed_help[34];
-  gengetopt_args_info_help[29] = gengetopt_args_info_detailed_help[35];
-  gengetopt_args_info_help[30] = gengetopt_args_info_detailed_help[36];
-  gengetopt_args_info_help[31] = gengetopt_args_info_detailed_help[37];
-  gengetopt_args_info_help[32] = gengetopt_args_info_detailed_help[38];
-  gengetopt_args_info_help[33] = gengetopt_args_info_detailed_help[39];
-  gengetopt_args_info_help[34] = gengetopt_args_info_detailed_help[40];
-  gengetopt_args_info_help[35] = gengetopt_args_info_detailed_help[41];
-  gengetopt_args_info_help[36] = gengetopt_args_info_detailed_help[42];
-  gengetopt_args_info_help[37] = 0; 
+  gengetopt_args_info_help[29] = gengetopt_args_info_detailed_help[36];
+  gengetopt_args_info_help[30] = gengetopt_args_info_detailed_help[37];
+  gengetopt_args_info_help[31] = gengetopt_args_info_detailed_help[38];
+  gengetopt_args_info_help[32] = gengetopt_args_info_detailed_help[39];
+  gengetopt_args_info_help[33] = gengetopt_args_info_detailed_help[40];
+  gengetopt_args_info_help[34] = gengetopt_args_info_detailed_help[41];
+  gengetopt_args_info_help[35] = gengetopt_args_info_detailed_help[42];
+  gengetopt_args_info_help[36] = gengetopt_args_info_detailed_help[43];
+  gengetopt_args_info_help[37] = gengetopt_args_info_detailed_help[44];
+  gengetopt_args_info_help[38] = 0; 
   
 }
 
-const char *gengetopt_args_info_help[38];
+const char *gengetopt_args_info_help[39];
 
 typedef enum {ARG_NO
   , ARG_FLAG
@@ -171,6 +221,7 @@ void clear_given (struct gengetopt_args_info *args_info)
 {
   args_info->help_given = 0 ;
   args_info->detailed_help_given = 0 ;
+  args_info->full_help_given = 0 ;
   args_info->version_given = 0 ;
   args_info->input_given = 0 ;
   args_info->func_name_given = 0 ;
@@ -184,6 +235,7 @@ void clear_given (struct gengetopt_args_info *args_info)
   args_info->long_help_given = 0 ;
   args_info->default_optional_given = 0 ;
   args_info->unamed_opts_given = 0 ;
+  args_info->unnamed_opts_given = 0 ;
   args_info->conf_parser_given = 0 ;
   args_info->string_parser_given = 0 ;
   args_info->include_getopt_given = 0 ;
@@ -226,6 +278,8 @@ void clear_args (struct gengetopt_args_info *args_info)
   args_info->header_extension_orig = NULL;
   args_info->unamed_opts_arg = gengetopt_strdup ("FILES");
   args_info->unamed_opts_orig = NULL;
+  args_info->unnamed_opts_arg = gengetopt_strdup ("FILES");
+  args_info->unnamed_opts_orig = NULL;
   args_info->show_required_arg = gengetopt_strdup ("(mandatory)");
   args_info->show_required_orig = NULL;
   args_info->gen_version_flag = 1;
@@ -239,39 +293,41 @@ void clear_args (struct gengetopt_args_info *args_info)
 static
 void init_args_info(struct gengetopt_args_info *args_info)
 {
-
+  init_full_help_array(); 
   init_help_array(); 
   args_info->help_help = gengetopt_args_info_detailed_help[0] ;
   args_info->detailed_help_help = gengetopt_args_info_detailed_help[1] ;
-  args_info->version_help = gengetopt_args_info_detailed_help[2] ;
-  args_info->input_help = gengetopt_args_info_detailed_help[5] ;
-  args_info->func_name_help = gengetopt_args_info_detailed_help[6] ;
-  args_info->arg_struct_name_help = gengetopt_args_info_detailed_help[7] ;
-  args_info->file_name_help = gengetopt_args_info_detailed_help[8] ;
-  args_info->output_dir_help = gengetopt_args_info_detailed_help[9] ;
-  args_info->header_output_dir_help = gengetopt_args_info_detailed_help[11] ;
-  args_info->src_output_dir_help = gengetopt_args_info_detailed_help[12] ;
-  args_info->c_extension_help = gengetopt_args_info_detailed_help[13] ;
-  args_info->header_extension_help = gengetopt_args_info_detailed_help[14] ;
-  args_info->long_help_help = gengetopt_args_info_detailed_help[15] ;
-  args_info->default_optional_help = gengetopt_args_info_detailed_help[17] ;
-  args_info->unamed_opts_help = gengetopt_args_info_detailed_help[18] ;
-  args_info->conf_parser_help = gengetopt_args_info_detailed_help[20] ;
-  args_info->string_parser_help = gengetopt_args_info_detailed_help[21] ;
-  args_info->include_getopt_help = gengetopt_args_info_detailed_help[24] ;
-  args_info->no_handle_help_help = gengetopt_args_info_detailed_help[25] ;
-  args_info->no_help_help = gengetopt_args_info_detailed_help[27] ;
-  args_info->no_handle_version_help = gengetopt_args_info_detailed_help[29] ;
-  args_info->no_version_help = gengetopt_args_info_detailed_help[30] ;
-  args_info->no_handle_error_help = gengetopt_args_info_detailed_help[32] ;
-  args_info->show_required_help = gengetopt_args_info_detailed_help[34] ;
-  args_info->gen_version_help = gengetopt_args_info_detailed_help[35] ;
-  args_info->set_package_help = gengetopt_args_info_detailed_help[36] ;
-  args_info->set_version_help = gengetopt_args_info_detailed_help[37] ;
-  args_info->show_help_help = gengetopt_args_info_detailed_help[38] ;
-  args_info->show_full_help_help = gengetopt_args_info_detailed_help[39] ;
-  args_info->show_detailed_help_help = gengetopt_args_info_detailed_help[40] ;
-  args_info->show_version_help = gengetopt_args_info_detailed_help[41] ;
+  args_info->full_help_help = gengetopt_args_info_detailed_help[2] ;
+  args_info->version_help = gengetopt_args_info_detailed_help[3] ;
+  args_info->input_help = gengetopt_args_info_detailed_help[6] ;
+  args_info->func_name_help = gengetopt_args_info_detailed_help[7] ;
+  args_info->arg_struct_name_help = gengetopt_args_info_detailed_help[8] ;
+  args_info->file_name_help = gengetopt_args_info_detailed_help[9] ;
+  args_info->output_dir_help = gengetopt_args_info_detailed_help[10] ;
+  args_info->header_output_dir_help = gengetopt_args_info_detailed_help[12] ;
+  args_info->src_output_dir_help = gengetopt_args_info_detailed_help[13] ;
+  args_info->c_extension_help = gengetopt_args_info_detailed_help[14] ;
+  args_info->header_extension_help = gengetopt_args_info_detailed_help[15] ;
+  args_info->long_help_help = gengetopt_args_info_detailed_help[16] ;
+  args_info->default_optional_help = gengetopt_args_info_detailed_help[18] ;
+  args_info->unamed_opts_help = gengetopt_args_info_detailed_help[19] ;
+  args_info->unnamed_opts_help = gengetopt_args_info_detailed_help[20] ;
+  args_info->conf_parser_help = gengetopt_args_info_detailed_help[22] ;
+  args_info->string_parser_help = gengetopt_args_info_detailed_help[23] ;
+  args_info->include_getopt_help = gengetopt_args_info_detailed_help[26] ;
+  args_info->no_handle_help_help = gengetopt_args_info_detailed_help[27] ;
+  args_info->no_help_help = gengetopt_args_info_detailed_help[29] ;
+  args_info->no_handle_version_help = gengetopt_args_info_detailed_help[31] ;
+  args_info->no_version_help = gengetopt_args_info_detailed_help[32] ;
+  args_info->no_handle_error_help = gengetopt_args_info_detailed_help[34] ;
+  args_info->show_required_help = gengetopt_args_info_detailed_help[36] ;
+  args_info->gen_version_help = gengetopt_args_info_detailed_help[37] ;
+  args_info->set_package_help = gengetopt_args_info_detailed_help[38] ;
+  args_info->set_version_help = gengetopt_args_info_detailed_help[39] ;
+  args_info->show_help_help = gengetopt_args_info_detailed_help[40] ;
+  args_info->show_full_help_help = gengetopt_args_info_detailed_help[41] ;
+  args_info->show_detailed_help_help = gengetopt_args_info_detailed_help[42] ;
+  args_info->show_version_help = gengetopt_args_info_detailed_help[43] ;
   
 }
 
@@ -308,6 +364,15 @@ cmdline_parser_print_help (void)
 }
 
 void
+cmdline_parser_print_full_help (void)
+{
+  int i = 0;
+  print_help_common();
+  while (gengetopt_args_info_full_help[i])
+    printf("%s\n", gengetopt_args_info_full_help[i++]);
+}
+
+void
 cmdline_parser_print_detailed_help (void)
 {
   int i = 0;
@@ -381,6 +446,8 @@ cmdline_parser_release (struct gengetopt_args_info *args_info)
   free_string_field (&(args_info->header_extension_orig));
   free_string_field (&(args_info->unamed_opts_arg));
   free_string_field (&(args_info->unamed_opts_orig));
+  free_string_field (&(args_info->unnamed_opts_arg));
+  free_string_field (&(args_info->unnamed_opts_orig));
   free_string_field (&(args_info->show_required_arg));
   free_string_field (&(args_info->show_required_orig));
   free_string_field (&(args_info->set_package_arg));
@@ -421,6 +488,8 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
     write_into_file(outfile, "help", 0, 0 );
   if (args_info->detailed_help_given)
     write_into_file(outfile, "detailed-help", 0, 0 );
+  if (args_info->full_help_given)
+    write_into_file(outfile, "full-help", 0, 0 );
   if (args_info->version_given)
     write_into_file(outfile, "version", 0, 0 );
   if (args_info->input_given)
@@ -447,6 +516,8 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
     write_into_file(outfile, "default-optional", 0, 0 );
   if (args_info->unamed_opts_given)
     write_into_file(outfile, "unamed-opts", args_info->unamed_opts_orig, 0);
+  if (args_info->unnamed_opts_given)
+    write_into_file(outfile, "unnamed-opts", args_info->unnamed_opts_orig, 0);
   if (args_info->conf_parser_given)
     write_into_file(outfile, "conf-parser", 0, 0 );
   if (args_info->string_parser_given)
@@ -709,6 +780,7 @@ cmdline_parser_internal (
       static struct option long_options[] = {
         { "help",	0, NULL, 'h' },
         { "detailed-help",	0, NULL, 0 },
+        { "full-help",	0, NULL, 0 },
         { "version",	0, NULL, 'V' },
         { "input",	1, NULL, 'i' },
         { "func-name",	1, NULL, 'f' },
@@ -722,6 +794,7 @@ cmdline_parser_internal (
         { "long-help",	0, NULL, 'l' },
         { "default-optional",	0, NULL, 0 },
         { "unamed-opts",	2, NULL, 'u' },
+        { "unnamed-opts",	2, NULL, 0 },
         { "conf-parser",	0, NULL, 'C' },
         { "string-parser",	0, NULL, 'S' },
         { "include-getopt",	0, NULL, 'G' },
@@ -971,6 +1044,22 @@ cmdline_parser_internal (
             return 0;
           
           }
+          /* Print help, including hidden options, and exit.  */
+          else if (strcmp (long_options[option_index].name, "full-help") == 0)
+          {
+          
+          
+            if (update_arg( 0 , 
+                 0 , &(args_info->full_help_given),
+                &(local_args_info.full_help_given), optarg, 0, 0, ARG_NO,
+                check_ambiguity, override, 0, 0,
+                "full-help", '-',
+                additional_error))
+              goto failure;
+            cmdline_parser_free (&local_args_info);
+            return 0;
+          
+          }
           /* output directory.  */
           else if (strcmp (long_options[option_index].name, "output-dir") == 0)
           {
@@ -1027,6 +1116,20 @@ cmdline_parser_internal (
               goto failure;
           
           }
+          /* synonym for --unnamed-opts, accepted for backwards compatibility.  */
+          else if (strcmp (long_options[option_index].name, "unnamed-opts") == 0)
+          {
+          
+          
+            if (update_arg( (void *)&(args_info->unnamed_opts_arg), 
+                 &(args_info->unnamed_opts_orig), &(args_info->unnamed_opts_given),
+                &(local_args_info.unnamed_opts_given), optarg, 0, "FILES", ARG_STRING,
+                check_ambiguity, override, 0, 0,
+                "unnamed-opts", '-',
+                additional_error))
+              goto failure;
+          
+          }
           /* do not add --help|-h automatically.  */
           else if (strcmp (long_options[option_index].name, "no-help") == 0)
           {
diff --git a/src/cmdline.ggo b/src/cmdline.ggo
index 4c057f0..508db91 100644
--- a/src/cmdline.ggo
+++ b/src/cmdline.ggo
@@ -71,18 +71,19 @@ option  "func-name"     f "name of generated function" string typestr="name"  de
 option  "arg-struct-name" a "name of generated args info struct" string typestr="name"  default="gengetopt_args_info"   optional
 option  "file-name"     F "name of generated file"  string typestr="name"  default="cmdline"     optional
 option  "output-dir"     - "output directory"  string typestr="path"  optional
-	details="\nif this option is not specified, the \
+        details="\nif this option is not specified, the \
 files are generated in the current directory.\n"
 option  "header-output-dir"     - "header output directory"  string typestr="path" optional
 option  "src-output-dir"     - "source output directory"  string typestr="path" optional
 option  "c-extension"   c "extension of c file" string typestr="ext" default="c" optional
 option  "header-extension"   H "extension of header file" string typestr="ext" default="h" optional
 option  "long-help"     l "long usage line in help" optional
-	details="\nThe usage line will print all the options, e.g.,
+        details="\nThe usage line will print all the options, e.g.,
 
 sample1 -iINT|--int-opt=INT [-h|--help]\n"
 option  "default-optional"     - "by default, an option is considered optional if not specified otherwise" optional
-option  "unamed-opts"   u "accept options without names (e.g., file names)" string default="FILES" optional argoptional
+option  "unnamed-opts"   u "accept options without names (e.g., file names)" string default="FILES" optional argoptional
+option  "unamed-opts" - "synonym for --unnamed-opts, accepted for backwards compatibility" string default="FILES" optional argoptional hidden
 
 text "\nThe parser generated is thought to be used to parse the command line arguments. "
 text "However, you can also generate parsers for configuration files, or strings "
@@ -98,7 +99,7 @@ section "Additional options"
 option  "include-getopt" G "adds the code for getopt_long in the generated C file" optional
 
 option  "no-handle-help"   n "do not handle --help|-h automatically" optional
-	details="\nIf --no-handle-help is specified, the command line option \
+        details="\nIf --no-handle-help is specified, the command line option \
 --help|-h will not be handled automatically, so the programmer will be able \
 to print some \
 other information; then the function for printing the standard help \
@@ -108,10 +109,10 @@ that, although the programmer can handle --help|-h manually, the \
 parser will return after finding such option: the other command \
 line options, if any, will be ignored.  In case you want to have full \
 control on --help|-h, you should use --ho-help.\n"
-	
+
 option  "no-help"   - "do not add --help|-h automatically" optional
-	details="\nWith this option you can disable the \
-automatic addition of options --help|-h. The programmer \ 
+        details="\nWith this option you can disable the \
+automatic addition of options --help|-h. The programmer \
 will then be able to add this option in \
 the input file and handle it as he sees fit.  Notice that \
 --no-help will also disable the automatic options \
@@ -125,11 +126,11 @@ specifies --no-help \
 
 option  "no-handle-version"  N  "do not handle --version|-V automatically" optional
 option  "no-version"  -  "do not add --version|-V automatically" optional
-	details="\nSee above the details about \
+        details="\nSee above the details about \
 --no-handle-help and --no-help, respectively.\n"
 
 option  "no-handle-error" e "do not exit on errors" optional
-	details="\nWith this option, if the generated parser encounters an error \
+        details="\nWith this option, if the generated parser encounters an error \
 (e.g., an unknown option) it does not make the main program exit; instead, the parser \
 function returns a value different 0, and the main program can print a help message.\n"
 
diff --git a/src/cmdline.h b/src/cmdline.h
index a718a31..8079054 100644
--- a/src/cmdline.h
+++ b/src/cmdline.h
@@ -1,6 +1,6 @@
 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22.5
+ *  generated by GNU Gengetopt version 2.22.6
  *  http://www.gnu.org/software/gengetopt.
  *  DO NOT modify this file, since it can be overwritten
  *  @author GNU Gengetopt by Lorenzo Bettini */
@@ -43,6 +43,7 @@ struct gengetopt_args_info
 {
   const char *help_help; /**< @brief Print help and exit help description.  */
   const char *detailed_help_help; /**< @brief Print help, including all details and hidden options, and exit help description.  */
+  const char *full_help_help; /**< @brief Print help, including hidden options, and exit help description.  */
   const char *version_help; /**< @brief Print version and exit help description.  */
   char * input_arg;	/**< @brief input file (default std input).  */
   char * input_orig;	/**< @brief input file (default std input) original value given at command line.  */
@@ -76,6 +77,9 @@ struct gengetopt_args_info
   char * unamed_opts_arg;	/**< @brief accept options without names (e.g., file names) (default='FILES').  */
   char * unamed_opts_orig;	/**< @brief accept options without names (e.g., file names) original value given at command line.  */
   const char *unamed_opts_help; /**< @brief accept options without names (e.g., file names) help description.  */
+  char * unnamed_opts_arg;	/**< @brief synonym for --unnamed-opts, accepted for backwards compatibility (default='FILES').  */
+  char * unnamed_opts_orig;	/**< @brief synonym for --unnamed-opts, accepted for backwards compatibility original value given at command line.  */
+  const char *unnamed_opts_help; /**< @brief synonym for --unnamed-opts, accepted for backwards compatibility help description.  */
   const char *conf_parser_help; /**< @brief generate a config file parser help description.  */
   const char *string_parser_help; /**< @brief generate a string parser (the string contains the command line) help description.  */
   const char *include_getopt_help; /**< @brief adds the code for getopt_long in the generated C file help description.  */
@@ -102,6 +106,7 @@ struct gengetopt_args_info
   
   unsigned int help_given ;	/**< @brief Whether help was given.  */
   unsigned int detailed_help_given ;	/**< @brief Whether detailed-help was given.  */
+  unsigned int full_help_given ;	/**< @brief Whether full-help was given.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
   unsigned int input_given ;	/**< @brief Whether input was given.  */
   unsigned int func_name_given ;	/**< @brief Whether func-name was given.  */
@@ -115,6 +120,7 @@ struct gengetopt_args_info
   unsigned int long_help_given ;	/**< @brief Whether long-help was given.  */
   unsigned int default_optional_given ;	/**< @brief Whether default-optional was given.  */
   unsigned int unamed_opts_given ;	/**< @brief Whether unamed-opts was given.  */
+  unsigned int unnamed_opts_given ;	/**< @brief Whether unnamed-opts was given.  */
   unsigned int conf_parser_given ;	/**< @brief Whether conf-parser was given.  */
   unsigned int string_parser_given ;	/**< @brief Whether string-parser was given.  */
   unsigned int include_getopt_given ;	/**< @brief Whether include-getopt was given.  */
@@ -150,6 +156,8 @@ extern const char *gengetopt_args_info_purpose;
 extern const char *gengetopt_args_info_usage;
 /** @brief all the lines making the help output */
 extern const char *gengetopt_args_info_help[];
+/** @brief all the lines making the full help output (including hidden options) */
+extern const char *gengetopt_args_info_full_help[];
 /** @brief all the lines making the detailed help output (including hidden options and details) */
 extern const char *gengetopt_args_info_detailed_help[];
 
@@ -214,6 +222,10 @@ int cmdline_parser_file_save(const char *filename,
  */
 void cmdline_parser_print_help(void);
 /**
+ * Print the full help (including hidden options)
+ */
+void cmdline_parser_print_full_help(void);
+/**
  * Print the detailed help (including hidden options and details)
  */
 void cmdline_parser_print_detailed_help(void);
diff --git a/src/gengetopt.cc b/src/gengetopt.cc
index fdbc478..b91f92e 100644
--- a/src/gengetopt.cc
+++ b/src/gengetopt.cc
@@ -258,7 +258,8 @@ main (int argc, char **argv)
   CmdlineParserCreator cmdline_parser_creator
     (cmdline_parser_name,
      args_info.arg_struct_name_arg,
-     (args_info.unamed_opts_given ? args_info.unamed_opts_arg : 0),
+     (args_info.unnamed_opts_given ? args_info.unnamed_opts_arg :
+      (args_info.unamed_opts_given ? args_info.unamed_opts_arg : 0)),
      cmdline_filename,
      header_ext,
      c_ext,
-- 
1.7.4.1

