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

« back to all changes in this revision

Viewing changes to doc/gengetopt.html

  • 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
<html lang="en">
2
2
<head>
3
 
<title>GNU Gengetopt 2.22.5</title>
 
3
<title>GNU Gengetopt 2.22.6</title>
4
4
<meta http-equiv="Content-Type" content="text/html">
5
 
<meta name="description" content="GNU Gengetopt 2.22.5">
 
5
<meta name="description" content="GNU Gengetopt 2.22.6">
6
6
<meta name="generator" content="makeinfo 4.13">
7
7
<link title="Top" rel="top" href="#Top">
8
8
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9
9
<!--
10
10
This manual is for GNU Gengetopt
11
 
(version 2.22.5, 25 September 2011),
 
11
(version 2.22.6, 2 November 2012),
12
12
a tool to write command line option parsers for C programs.
13
13
 
14
14
Copyright (C) 2001 - 2011 Free Software Foundation, Inc.
39
39
--></style>
40
40
</head>
41
41
<body>
42
 
<h1 class="settitle">GNU Gengetopt 2.22.5</h1>
 
42
<h1 class="settitle">GNU Gengetopt 2.22.6</h1>
43
43
   <div class="contents">
44
44
<h2>Table of Contents</h2>
45
45
<ul>
99
99
 
100
100
<p>Gengetopt is a tool to write command line option parsing code for C programs.
101
101
 
102
 
   <p>This is Edition 2.22.5 of the Gengetopt manual.
 
102
   <p>This is Edition 2.22.6 of the Gengetopt manual.
103
103
 
104
 
   <p>This file documents GNU Gengetopt version 2.22.5.
 
104
   <p>This file documents GNU Gengetopt version 2.22.6.
105
105
 
106
106
   <p>This manual is for GNU Gengetopt
107
 
(version 2.22.5, 25 September 2011),
 
107
(version 2.22.6, 2 November 2012),
108
108
a tool to write command line option parsers for C programs.
109
109
 
110
110
   <p>Copyright &copy; 2001 - 2011 Free Software Foundation, Inc.
136
136
<li><a accesskey="5" href="#Invoking-gengetopt">Invoking gengetopt</a>:           gengetopt command line options
137
137
<li><a accesskey="6" href="#Terminology">Terminology</a>:                  Definitions of options, values, and so forth. 
138
138
<li><a accesskey="7" href="#Options-with-enumerated-values">Options with enumerated values</a>:   Options accepting only a list of values
139
 
<li><a accesskey="8" href="#Group-options">Group options</a>:                Groups of mutual exclusive options
140
 
<li><a accesskey="9" href="#Mode-options">Mode options</a>:                 Mutual exclusive group of options
 
139
<li><a accesskey="8" href="#Group-options">Group options</a>:                Groups of mutually exclusive options
 
140
<li><a accesskey="9" href="#Mode-options">Mode options</a>:                 Mutually exclusive group of options
141
141
<li><a href="#Parser-function-additional-parameters">Parser function additional parameters</a>
142
142
<li><a href="#Configuration-files">Configuration files</a>:          Parsing a configuration file
143
143
<li><a href="#Multiple-Options">Multiple Options</a>:             Multiple options
144
144
<li><a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a>:   Using multiple parsers in the same program
145
145
<li><a href="#No-getopt_005flong">No getopt_long</a>:               What if getopt_long is not available? 
146
 
<li><a href="#Bugs">Bugs</a>:                         What is lame and/or buggy in Gengetopt 2.22.5
 
146
<li><a href="#Bugs">Bugs</a>:                         What is lame and/or buggy in Gengetopt 2.22.6
147
147
<li><a href="#Mailing-Lists">Mailing Lists</a>:                For discussions and announces
148
148
<li><a href="#Index">Index</a>:                        Index. 
149
149
</ul>
386
386
     purpose "&lt;purpose&gt;"
387
387
     usage "&lt;usage&gt;"
388
388
     description "&lt;description&gt;"
 
389
     versiontext "&lt;versiontext&gt;"
389
390
     
390
391
     args "&lt;command line options&gt;"
391
392
     
435
436
The &ldquo;Description&rdquo; string that will be printed with the
436
437
help<a rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>, after the usage string.  Optional.
437
438
 
438
 
     <br><dt><code>args</code><dd><a name="index-args-32"></a>
 
439
     <br><dt><code>versiontext</code><dd><a name="index-versiontext-32"></a>
 
440
Additional information that will be printed after the program name and
 
441
version in the output of <code>--version</code>. This would be used, for
 
442
example, to display copyright and licensing information.
 
443
 
 
444
     <br><dt><code>args</code><dd><a name="index-args-33"></a>
439
445
With <code>args</code><a rel="footnote" href="#fn-8" name="fnd-8"><sup>8</sup></a> you can specify options
440
446
that will be added to the command line options of gengetopt itself.  For
441
447
instance, if you always run gengetopt on your input file with the
447
453
     <p class="noindent">and remove those recurrent options from the command line. 
448
454
Optional.
449
455
 
450
 
     <br><dt><code>long</code><dd><a name="index-long-33"></a>
 
456
     <br><dt><code>long</code><dd><a name="index-long-34"></a>
451
457
The long option, a double quoted string with upper and lower case
452
458
characters, digits, a dash (<code>-</code>) and a dot (<code>.</code>).  No spaces
453
459
allowed.  The name of the variables generated to store arguments (see
455
461
names.  This means that <code>.</code> and <code>-</code> are both replaced by
456
462
<code>_</code>.
457
463
 
458
 
     <p><a name="index-short-34"></a><br><dt><code>short</code><dd>
 
464
     <p><a name="index-short-35"></a><br><dt><code>short</code><dd>
459
465
The short option, a single upper or lower case char, or a digit.  If
460
466
a <code>-</code> is specified, then no short option is considered for the long
461
467
option (thus long options with no associated short options are allowed). 
462
468
Since version 2.22 you can also specify <code>?</code> as the short option.
463
469
 
464
 
     <p><a name="index-desc-35"></a><br><dt><code>desc</code><dd>
465
 
<a name="index-wrapping-36"></a>This description will be printed during the output of
 
470
     <p><a name="index-desc-36"></a><br><dt><code>desc</code><dd>
 
471
<a name="index-wrapping-37"></a>This description will be printed during the output of
466
472
<code>--help</code>.  Wrapping will be automatically performed.
467
473
 
468
 
     <br><dt><code>details</code><dd><a name="index-details-37"></a><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-38"></a>
 
474
     <br><dt><code>details</code><dd><a name="index-details-38"></a><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-39"></a>
469
475
This is an extended description string for the option that will be
470
476
printed (after the option) during the output of
471
477
<code>--detailed-help</code><a rel="footnote" href="#fn-9" name="fnd-9"><sup>9</sup></a>, which will be
473
479
printed with <code>--help</code>.  Wrapping will be automatically performed. 
474
480
Optional.
475
481
 
476
 
     <p><a name="index-argtype-39"></a><br><dt><code>argtype</code><dd>
 
482
     <p>Note that if <code>--strict-hidden</code> is used, options that are hidden
 
483
(See <a href="#hidden">Hidden options</a>.) will not appear in the output of
 
484
<code>--detailed-help</code>, even if those options have details.
 
485
 
 
486
     <p><a name="index-argtype-40"></a><br><dt><code>argtype</code><dd>
477
487
<code>string</code>, <code>int</code>, <code>short</code>, <code>long</code>, <code>float</code>,
478
488
<code>double</code>, <code>longdouble</code> or <code>longlong</code>.  If the option is
479
489
an enumerated one (see <a href="#Options-with-enumerated-values">Options with enumerated values</a>) the type
480
490
can also be <code>enum</code>.  If no type is specified the option does not
481
491
accept an argument.
482
492
 
483
 
     <p><a name="index-typestr-40"></a><br><dt><code>typestr</code><dd>
 
493
     <p><a name="index-typestr-41"></a><br><dt><code>typestr</code><dd>
484
494
a description for the type of the values for the option.   This will be
485
495
used during the output of <code>--help</code> (e.g., <code>"filename"</code> instead
486
496
of simply <code>STRING</code>, or <code>"portnumber"</code> instead of simply
487
497
<code>INT</code>).
488
498
 
489
 
     <p><a name="index-values-41"></a><br><dt><code>values</code><dd>
 
499
     <p><a name="index-values-42"></a><br><dt><code>values</code><dd>
490
500
a list of strings containing all the possible values that can be passed
491
501
to the option.  If not specified, the type is considered
492
502
string<a rel="footnote" href="#fn-10" name="fnd-10"><sup>10</sup></a>.  For this
493
503
kind of options, the type can also be <code>enum</code>.  More on this feature
494
504
can be found in <a href="#Options-with-enumerated-values">Options with enumerated values</a>.
495
505
 
496
 
     <p><a name="index-default-42"></a><br><dt><code>default</code><dd>
 
506
     <p><a name="index-default-43"></a><br><dt><code>default</code><dd>
497
507
an optional default value for the option.  The value must always be
498
508
specified as a double quoted string.  It is possible to combine this
499
509
with the <code>multiple</code> flag (<a href="#Multiple-Options">Multiple Options</a>) but only by
500
510
giving a single default value. It is not possible to specify a list of
501
511
default values.
502
512
 
503
 
     <p><a name="index-dependon-43"></a><br><dt><code>dependon</code><dd>
 
513
     <p><a name="index-dependon-44"></a><br><dt><code>dependon</code><dd>
504
514
this option depends on another option (whose long name description is
505
515
specified).  If this option is given at command line but not the option
506
516
it depends on, an error will be generated.
507
517
 
508
 
     <p><a name="index-required-44"></a><a name="index-optional-45"></a><a name="index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-46"></a><br><dt><code>required</code><dd>
 
518
     <p><a name="index-required-45"></a><a name="index-optional-46"></a><a name="index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-47"></a><br><dt><code>required</code><dd>
509
519
<code>required</code> or <code>optional</code>.  This specifies whether such option
510
520
must be given at each program invocation.  These keywords were
511
521
introduced in release 2.17.  Before, you had to use the keywords
517
527
optional, by using the command line option
518
528
<code>--default-optional</code><a rel="footnote" href="#fn-11" name="fnd-11"><sup>11</sup></a>.
519
529
 
520
 
     <p><a name="index-argoptional-47"></a><br><dt><code>argoptional</code><dd>
 
530
     <p><a name="index-argoptional-48"></a><br><dt><code>argoptional</code><dd>
521
531
If this flag is specified then this option has an argument that is
522
532
optional.  In this case, when you specify the argument at command line,
523
533
please use <code>=</code> in case you use a long option, and avoid spaces if
531
541
value, and if it is specified without an argument it will have, again,
532
542
the default value.
533
543
 
534
 
     <p><a name="index-multiple-48"></a><br><dt><code>multiple</code><dd>
 
544
     <p><a name="index-multiple-49"></a><br><dt><code>multiple</code><dd>
535
545
If this flag is specified then this option can be specified more than
536
546
once at command line; all the values for this option are stored in an
537
547
array.  You can also specify the number of occurrences that a multiple
538
548
option must be specified.  Notice that this is independent from the
539
549
<code>required</code> flag.  See <a href="#Multiple-Options">Multiple Options</a>.
540
550
 
541
 
     <p><a name="index-hidden-49"></a><a name="index-details-50"></a><a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-51"></a><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-52"></a><br><dt><code>hidden</code><dd>
542
 
<a name="hidden"></a><a name="fullhelp"></a>If an option is &ldquo;hidden&rdquo; it will not appear in the
543
 
output of <code>--help</code> but it can still be specified at command
544
 
line<a rel="footnote" href="#fn-12" name="fnd-12"><sup>12</sup></a>.  In case hidden options are used,
545
 
the command line option <code>--full-help</code> will also be generated.  This
546
 
will print also the hidden options<a rel="footnote" href="#fn-13" name="fnd-13"><sup>13</sup></a>.  If
547
 
there's an option with <code>details</code>, then also
548
 
<code>--detailed-help</code><a rel="footnote" href="#fn-14" name="fnd-14"><sup>14</sup></a> will be
549
 
automatically generated;  if one then specifies <code>--detailed-help</code>
550
 
also hidden options will be printed (besides the details for options).
551
 
 
552
 
     <p><a name="index-on_002foff-53"></a><br><dt><code>on/off</code><dd>
 
551
     <p><a name="index-hidden-50"></a><a name="index-details-51"></a><a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-52"></a><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-53"></a><br><dt><code>hidden</code><dd>
 
552
<a name="hidden"></a><a name="fullhelp"></a>If an option is &ldquo;hidden&rdquo; it will not appear in the output of
 
553
<code>--help</code> but it can still be specified at command
 
554
line<a rel="footnote" href="#fn-12" name="fnd-12"><sup>12</sup></a>.  When hidden options are used, the
 
555
command line option <code>--full-help</code> will also be generated.  This
 
556
will also print hidden options<a rel="footnote" href="#fn-13" name="fnd-13"><sup>13</sup></a>.  Hidden
 
557
options are also displayed in the output of <code>--detailed-help</code>, if
 
558
it is present, along with any details that those options have.
 
559
 
 
560
     <p>Note that when <code>--strict-hidden</code> is used, hidden options do not
 
561
appear as described above, although they can still be given on the
 
562
comand line.  That is to say, the <code>--full-help</code> option is not
 
563
generated, and hidden options do not appear in the output of
 
564
<code>--detailed-help</code>, even if they have details.
 
565
 
 
566
     <p><a name="index-on_002foff-54"></a><br><dt><code>on/off</code><dd>
553
567
<code>on</code> or <code>off</code>.  This is the state of the flag when the program
554
568
starts. If user specifies the option, the flag toggles.
555
569
 
556
570
   </dl>
557
571
 
558
572
   <p>For strings (delimited by <code>"</code>) the following convention is
559
 
adopted<a rel="footnote" href="#fn-15" name="fnd-15"><sup>15</sup></a>: a string
 
573
adopted<a rel="footnote" href="#fn-14" name="fnd-14"><sup>14</sup></a>: a string
560
574
spanning more than one line will be interpreted with the corresponding
561
575
line breaks; if the line break is not desired one can use the backslash
562
576
<code>\</code> to break the line without inserting a line break.  A line break
573
587
     "This string\nwill have a line break"
574
588
</pre>
575
589
   <p class="noindent">Moreover, if the character <code>"</code> must be specified in the string, it
576
 
will have to be escaped with the backslash<a rel="footnote" href="#fn-16" name="fnd-16"><sup>16</sup></a>:
 
590
will have to be escaped with the backslash<a rel="footnote" href="#fn-15" name="fnd-15"><sup>15</sup></a>:
577
591
 
578
592
<pre class="example">     "This string contains \"a quoted string\" inside"
579
593
</pre>
581
595
 
582
596
<pre class="example">     option &lt;long&gt; &lt;short&gt; "&lt;desc&gt;"
583
597
</pre>
584
 
   <p class="noindent">while the other specifications can be given in any order<a rel="footnote" href="#fn-17" name="fnd-17"><sup>17</sup></a>.  Thus, for instance
 
598
   <p class="noindent">while the other specifications can be given in any order<a rel="footnote" href="#fn-16" name="fnd-16"><sup>16</sup></a>.  Thus, for instance
585
599
 
586
600
<pre class="example">     option &lt;long&gt; &lt;short&gt; "&lt;desc&gt;" {argtype} {typestr="&lt;type descr&gt;"}
587
601
</pre>
592
606
   <p>Comments begin with <code>#</code> in any place (but in strings) of the line
593
607
and ends in the end of line.
594
608
 
595
 
   <p><a name="index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-54"></a><a name="index-g_t_0040code_007b_002dV_002c_002d_002dversion_007d-55"></a><a name="addedoptions"></a>Notice that the options <code>-h,--help</code> and
 
609
   <p><a name="index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-55"></a><a name="index-g_t_0040code_007b_002dV_002c_002d_002dversion_007d-56"></a><a name="addedoptions"></a>Notice that the options <code>-h,--help</code> and
596
610
<code>-V,--version</code> are added automatically; however, if you specify an
597
611
option yourself that has <code>h</code> as short form, then only <code>--help</code>
598
 
is added<a rel="footnote" href="#fn-18" name="fnd-18"><sup>18</sup></a>.  The same holds for
 
612
is added<a rel="footnote" href="#fn-17" name="fnd-17"><sup>17</sup></a>.  The same holds for
599
613
<code>-V,--version</code>.
600
614
 
601
 
   <p><a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-56"></a>In case hidden options are used, See <a href="#hidden">Hidden options</a>, the
 
615
   <p><a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-57"></a>In case hidden options are used, See <a href="#hidden">Hidden options</a>, the
602
616
command line option <code>--full-help</code> will also be generated.  This
603
 
will print also the hidden options<a rel="footnote" href="#fn-19" name="fnd-19"><sup>19</sup></a>.
604
 
 
605
 
   <p><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-57"></a>If there's at least one option with <code>details</code>, the command line
 
617
will print also the hidden options<a rel="footnote" href="#fn-18" name="fnd-18"><sup>18</sup></a>.
 
618
 
 
619
   <p>Note, though, that when <code>--strict-hidden</code> is used, this is not
 
620
the case and <code>--full-help</code> is not generated.
 
621
 
 
622
   <p><a name="index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-58"></a>If there's at least one option with <code>details</code>, the command line
606
623
option <code>--detailed-help</code> will also be generated.  This will print
607
 
also the details for options and hidden options<a rel="footnote" href="#fn-20" name="fnd-20"><sup>20</sup></a>.
 
624
also the details for options and hidden options<a rel="footnote" href="#fn-19" name="fnd-19"><sup>19</sup></a> (except when <code>--strict-hidden</code> is used).
608
625
 
609
 
   <p><a name="index-section-58"></a>Options can be part of sections, that provide a more meaningful
 
626
   <p><a name="index-section-59"></a>Options can be part of sections, that provide a more meaningful
610
627
descriptions of the options.  A <em>section</em> can be defined with the
611
628
following syntax (the <code>sectiondesc</code> is optional) and all the options
612
629
following a section declaration are considered part of that sections:
614
631
<pre class="example">     section "section name" {sectiondesc="optional section description"}
615
632
</pre>
616
633
   <p class="noindent">Notice that the separation in sections is stronger than separation in
617
 
groups of mutual exclusive options (see <a href="#Group-options">Group options</a>). 
 
634
groups of mutually exclusive options (see <a href="#Group-options">Group options</a>). 
618
635
Furthermore, sections should not be inserted among group options (but
619
636
only externally).  A section makes sense only if it is followed by some
620
637
options.  If you don't specify any option after a section, that section
622
639
the output of <code>--help</code>, then you must use <code>text</code>, explained in
623
640
the next paragraph.
624
641
 
625
 
   <p><a name="index-text-59"></a>You can insert, among options, a textual string that will be printed in
626
 
the output of <code>--help</code><a rel="footnote" href="#fn-21" name="fnd-21"><sup>21</sup></a>:
 
642
   <p><a name="index-text-60"></a>You can insert, among options, a textual string that will be printed in
 
643
the output of <code>--help</code><a rel="footnote" href="#fn-20" name="fnd-20"><sup>20</sup></a>:
627
644
 
628
645
<pre class="example">     text "\nA text description with possible line\nbreaks"
629
646
</pre>
697
714
 
698
715
<pre class="example">     gengetopt &lt; sample1.ggo --file-name=cmdline1 --unamed-opts
699
716
</pre>
700
 
   <p><a name="index-parameter-60"></a><a name="index-option-without-name-61"></a>The option <code>--unamed-opts</code> allows the generated command line parser
 
717
   <p><a name="index-parameter-61"></a><a name="index-option-without-name-62"></a>The option <code>--unamed-opts</code> allows the generated command line parser
701
718
to accept also names, without an option (for instance you can pass a
702
719
file name without an option in front of it, and also use wildcards, such
703
720
as <code>*.c</code>, <code>foo*.?</code> and so on).   These are also called
709
726
<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
710
727
<pre class="example">     <i>/** </i><b>@file</b><i> cmdline1.h</i>
711
728
     <i> *  </i><b>@brief</b><i> The header file for the command line option parser</i>
712
 
     <i> *  generated by GNU Gengetopt version 2.22.5</i>
 
729
     <i> *  generated by GNU Gengetopt version 2.22.6</i>
713
730
     <i> *  </i><tt>http://www.gnu.org/software/gengetopt.</tt>
714
731
     <i> *  DO NOT modify this file, since it can be overwritten</i>
715
732
     <i> *  </i><b>@author</b><i> GNU Gengetopt by Lorenzo Bettini */</i>
814
831
     <b>extern</b> <b>const</b> <b>char</b> *gengetopt_args_info_purpose;
815
832
     <i>/** </i><b>@brief</b><i> the usage string of the program */</i>
816
833
     <b>extern</b> <b>const</b> <b>char</b> *gengetopt_args_info_usage;
 
834
     <i>/** </i><b>@brief</b><i> the description string of the program */</i>
 
835
     <b>extern</b> <b>const</b> <b>char</b> *gengetopt_args_info_description;
817
836
     <i>/** </i><b>@brief</b><i> all the lines making the help output */</i>
818
837
     <b>extern</b> <b>const</b> <b>char</b> *gengetopt_args_info_help[];
819
838
     <i>/** </i><b>@brief</b><i> all the lines making the full help output (including hidden options) */</i>
940
959
     <b>#endif</b> <i>/* CMDLINE1_H */</i>
941
960
     
942
961
</pre>
943
 
   <p><a name="index-argv-62"></a>First of all, notice that the <code>argv</code> parameter (typically
 
962
   <p><a name="index-argv-63"></a>First of all, notice that the <code>argv</code> parameter (typically
944
963
corresponding to the homonimous argument of your program's <code>main</code>
945
964
function) is declared as <code>char **</code> and not as <code>char *const
946
 
*</code><a rel="footnote" href="#fn-22" name="fnd-22"><sup>22</sup></a>.  Actually,
 
965
*</code><a rel="footnote" href="#fn-21" name="fnd-21"><sup>21</sup></a>.  Actually,
947
966
the version of <code>getopt_long</code> in libc uses prototypes with
948
967
<code>char *const *argv</code> that are incorrect because getopt_long and
949
968
getopt_long_only can permute argv; this is required for backward
950
 
compatibility (e.g., for LSB 2.0.1)<a rel="footnote" href="#fn-23" name="fnd-23"><sup>23</sup></a>.  So, it is better to declare
 
969
compatibility (e.g., for LSB 2.0.1)<a rel="footnote" href="#fn-22" name="fnd-22"><sup>22</sup></a>.  So, it is better to declare
951
970
<code>argv</code> as <code>char **</code> in the generated parser functions.
952
971
 
953
972
   <p>The <code>&lt;option&gt;_given</code> field is set to 1 when an argument for
954
 
<code>&lt;option&gt;</code> has been specified (otherwise it is 0)<a rel="footnote" href="#fn-24" name="fnd-24"><sup>24</sup></a>.  This fields also
 
973
<code>&lt;option&gt;</code> has been specified (otherwise it is 0)<a rel="footnote" href="#fn-23" name="fnd-23"><sup>23</sup></a>.  This fields also
955
974
counts the times a multiple option is specified (see <a href="#Multiple-Options">Multiple Options</a>).  If the option accepts an argument and it is not of
956
975
<code>flag</code> type The <code>&lt;option&gt;_arg</code> field is set to the value
957
976
passed at the command line.  The <code>&lt;option&gt;_arg</code> field has the
976
995
 
977
996
   <p>The user can always access this original value by using
978
997
<code>&lt;option&gt;_orig</code> instead of <code>&lt;option&gt;_arg</code>, as he sees
979
 
fit<a rel="footnote" href="#fn-25" name="fnd-25"><sup>25</sup></a>.  For instance, gengetopt itself uses the original value when it
 
998
fit<a rel="footnote" href="#fn-24" name="fnd-24"><sup>24</sup></a>.  For instance, gengetopt itself uses the original value when it
980
999
saves the command line options into a file (see the <code>_file_save</code>
981
1000
function in the following).  However, apart from very specific command
982
1001
line processing, the user might hardly need the <code>&lt;option&gt;_orig</code>
1000
1019
<code>details</code>, then the <code>cmdline_parser_detailed_help</code> array is
1001
1020
available (containing also help strings concerning hidden options and
1002
1021
details for options).  All these strings can be used by the programmer
1003
 
to build a customized help output<a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a>.
 
1022
to build a customized help output<a rel="footnote" href="#fn-25" name="fnd-25"><sup>25</sup></a>.
1004
1023
 
1005
1024
   <p>Even if <code>&lt;option&gt;_given</code> is 0, the corresponding
1006
1025
<code>&lt;option&gt;_arg</code> is set to default value (if one has been specified
1028
1047
not mandatory, since it is done automatically by the command line
1029
1048
parser).
1030
1049
 
1031
 
   <p><code>cmdline_parser_file_save</code><a rel="footnote" href="#fn-27" name="fnd-27"><sup>27</sup></a> can be used to save the command line options into a
 
1050
   <p><code>cmdline_parser_file_save</code><a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a> can be used to save the command line options into a
1032
1051
file.  The contents of this file are consistent with the configuration
1033
1052
files (<a href="#Configuration-files">Configuration files</a>).  Notice that if an option has a
1034
1053
default value, this option will be saved into the file only if it was
1035
1054
passed explicitly at command line (or read from a configuration file),
1036
1055
i.e., default values will not be saved into the file.  Alternatively,
1037
 
you can use <code>cmdline_parser_dump</code><a rel="footnote" href="#fn-28" name="fnd-28"><sup>28</sup></a> that takes as the first parameter an
 
1056
you can use <code>cmdline_parser_dump</code><a rel="footnote" href="#fn-27" name="fnd-27"><sup>27</sup></a> that takes as the first parameter an
1038
1057
already open stream (<code>FILE *</code>) instead of a file name.
1039
1058
 
1040
1059
   <p>And here's how these functions can be used inside the main program:
1044
1063
     <i>/* we try to use gengetopt generated file in a C++ program */</i>
1045
1064
     <i>/* we don't use autoconf and automake vars */</i>
1046
1065
     
 
1066
     <b>#ifdef</b> HAVE_CONFIG_H
 
1067
     <b>#include</b> <tt>"config.h"</tt>
 
1068
     <b>#endif</b>
 
1069
     
1047
1070
     <b>#include</b> <tt>&lt;iostream&gt;</tt>
1048
1071
     <b>#include</b> <tt>"stdlib.h"</tt>
1049
1072
     
1175
1198
     ...
1176
1199
     ./sample1: ambiguous argument, "b", for option `--enum-opt'
1177
1200
</pre>
1178
 
   <p><a name="showrequired"></a><a name="index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-63"></a>Here is the output of <code>--help</code> of the parser generated from
 
1201
   <p><a name="showrequired"></a><a name="index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-64"></a>Here is the output of <code>--help</code> of the parser generated from
1179
1202
<samp><span class="file">sample1.ggo</span></samp> by specifying the following options to gengetopt:
1180
1203
<code>--long-help -u --show-required</code> (see <a href="#Invoking-gengetopt">Invoking gengetopt</a> for
1181
1204
further explanation for these command line options).
1225
1248
     
1226
1249
     An ending text.
1227
1250
</pre>
1228
 
   <p><a name="index-wrapping-64"></a>Notice how <code>filename</code> is printed instead of <code>STRING</code> for the
 
1251
   <p><a name="index-wrapping-65"></a>Notice how <code>filename</code> is printed instead of <code>STRING</code> for the
1229
1252
option <code>--str-opt</code> (since <code>typestr</code> was used in the
1230
1253
<samp><span class="file">sample1.ggo</span></samp> file) and how the description of <code>--my-opt</code> is
1231
1254
wrapped to 80 columns, and how the <code>\n</code> is actually interpreted as
1232
1255
a newline request.  Also the usage string is wrapped.  Moreover, since
1233
1256
<code>-S,--secret</code> is
1234
 
<a name="index-hidden-65"></a>an hidden option (See <a href="#hidden">Hidden options</a>.) it is not printed;
1235
 
<a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-66"></a>if you wanted that to be printed, you should use <code>--full-help</code>. 
1236
 
<a name="index-details-67"></a>The option <code>--func-opt</code> has also the <code>details</code>, but they are
 
1257
<a name="index-hidden-66"></a>an hidden option (See <a href="#hidden">Hidden options</a>.) it is not printed;
 
1258
<a name="index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-67"></a>if you wanted that to be printed, you should use <code>--full-help</code>. 
 
1259
<a name="index-details-68"></a>The option <code>--func-opt</code> has also the <code>details</code>, but they are
1237
1260
not printed with <code>--help</code>.
1238
1261
 
1239
1262
   <p>Finally, notice how the <code>text</code> strings are printed in the help
1240
1263
output (and the empty line after the &ldquo;more involved options&rdquo; section
1241
1264
achieved with an empty <code>text</code> string).
1242
1265
 
1243
 
   <p><a name="index-g_t_0040code_007b_002dh_002c_002d_002ddetailed_002dhelp_007d-68"></a>Instead, here is the output of <code>--detailed-help</code> of the parser
 
1266
   <p><a name="index-g_t_0040code_007b_002dh_002c_002d_002ddetailed_002dhelp_007d-69"></a>Instead, here is the output of <code>--detailed-help</code> of the parser
1244
1267
generated from <samp><span class="file">sample1.ggo</span></samp>.  You may want to compare this output
1245
1268
with the one produced by <code>--help</code> (See <a href="#helpoutput">Output of <code>--help</code></a>.); in particular, you may notice that the hidden option
1246
1269
<code>--secret</code> is actually printed and the details of <code>--func-opt</code>
1315
1338
 
1316
1339
<h2 class="chapter">3 Invoking gengetopt</h2>
1317
1340
 
1318
 
<p><a name="index-invoking-69"></a><a name="index-gengetopt-options-70"></a>
 
1341
<p><a name="index-invoking-70"></a><a name="index-gengetopt-options-71"></a>
1319
1342
This is the output of <code>gengetopt --help</code>:
1320
1343
 
1321
1344
<pre class="smallexample">     gengetopt
1347
1370
           --default-optional        by default, an option is considered optional if
1348
1371
                                       not specified otherwise
1349
1372
       -u, --unamed-opts[=STRING]    accept options without names (e.g., file names)
1350
 
                                        (default=`FILES')
 
1373
                                       (default=`FILES')
1351
1374
     
1352
1375
     The parser generated is thought to be used to parse the command line arguments.
1353
1376
     However, you can also generate parsers for configuration files, or strings that
1357
1380
       -S, --string-parser           generate a string parser (the string contains
1358
1381
                                       the command line)
1359
1382
     
1360
 
     
1361
1383
     Additional options:
1362
1384
       -G, --include-getopt          adds the code for getopt_long in the generated
1363
1385
                                       C file
1369
1391
           --show-required[=STRING]  in the output of help will specify which
1370
1392
                                       options are mandatory, by using the optional
1371
1393
                                       passed string  (default=`(mandatory)')
 
1394
           --strict-hidden           completely hide hidden options
1372
1395
       -g, --gen-version             put gengetopt version in the generated file
1373
1396
                                       (default=on)
1374
1397
           --set-package=STRING      set the package name (override package defined
1390
1413
   <p>The options should be clear; in particular:
1391
1414
 
1392
1415
     <dl>
1393
 
<dt><code>--func-name</code><dd><a name="index-g_t_0040code_007b_002d_002dfunc_002dname_007d-71"></a>if no <code>--func-name</code> is given, <code>cmdline_parser</code> is taken by default;
 
1416
<dt><code>--func-name</code><dd><a name="index-g_t_0040code_007b_002d_002dfunc_002dname_007d-72"></a>if no <code>--func-name</code> is given, <code>cmdline_parser</code> is taken by default;
1394
1417
 
1395
 
     <br><dt><code>--output-dir</code><dd><a name="index-g_t_0040code_007b_002d_002doutput_002ddir_007d-72"></a>if no <code>--output-dir</code><a rel="footnote" href="#fn-29" name="fnd-29"><sup>29</sup></a> is given, the
 
1418
     <br><dt><code>--output-dir</code><dd><a name="index-g_t_0040code_007b_002d_002doutput_002ddir_007d-73"></a>if no <code>--output-dir</code><a rel="footnote" href="#fn-28" name="fnd-28"><sup>28</sup></a> is given, the
1396
1419
files are generated in the current directory;
1397
1420
 
1398
 
     <br><dt><code>--src-output-dir</code><br><dt><code>--header-output-dir</code><dd><a name="index-g_t_0040code_007b_002d_002dsrc_002doutput_002ddir_007d-73"></a><a name="index-g_t_0040code_007b_002d_002dheader_002doutput_002ddir_007d-74"></a>With these options<a rel="footnote" href="#fn-30" name="fnd-30"><sup>30</sup></a> the generated C
 
1421
     <br><dt><code>--src-output-dir</code><br><dt><code>--header-output-dir</code><dd><a name="index-g_t_0040code_007b_002d_002dsrc_002doutput_002ddir_007d-74"></a><a name="index-g_t_0040code_007b_002d_002dheader_002doutput_002ddir_007d-75"></a>With these options<a rel="footnote" href="#fn-29" name="fnd-29"><sup>29</sup></a> the generated C
1399
1422
file and the corresponding generated header files can be generated
1400
1423
in different directories;
1401
1424
 
1402
 
     <br><dt><code>--arg-struct-name</code><dd><a name="index-g_t_0040code_007b_002d_002darg_002dstruct_002dname_007d-75"></a>allows to specify the name of the generated struct for command line
 
1425
     <br><dt><code>--arg-struct-name</code><dd><a name="index-g_t_0040code_007b_002d_002darg_002dstruct_002dname_007d-76"></a>allows to specify the name of the generated struct for command line
1403
1426
arguments (default is <code>gengetopt_args_info</code>)
1404
1427
 
1405
 
     <br><dt><code>--long-help</code><dd><a name="index-g_t_0040code_007b_002d_002dlong_002dhelp_007d-76"></a>the &ldquo;Usage&rdquo; line reports all the options;
 
1428
     <br><dt><code>--long-help</code><dd><a name="index-g_t_0040code_007b_002d_002dlong_002dhelp_007d-77"></a>the &ldquo;Usage&rdquo; line reports all the options;
1406
1429
this may be unpleasant if options are many;
1407
1430
 
1408
 
     <br><dt><code>--default-optional</code><dd><a name="index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-77"></a>If this command line option is given, by default, options are considered
 
1431
     <br><dt><code>--default-optional</code><dd><a name="index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-78"></a>If this command line option is given, by default, options are considered
1409
1432
optional (if not explicitly specified otherwise).  Otherwise, options
1410
1433
are considered mandatory (if not explicitly specified otherwise).
1411
1434
 
1412
 
     <br><dt><code>--unamed-opts</code><dd><a name="index-g_t_0040code_007b_002d_002dunamed_002dopts_007d-78"></a>the program will accept also options without a name, which, in most
 
1435
     <br><dt><code>--unamed-opts</code><dd><a name="index-g_t_0040code_007b_002d_002dunamed_002dopts_007d-79"></a>the program will accept also options without a name, which, in most
1413
1436
case, means that we can pass many file names to the program (see the
1414
1437
example in <a href="#Basic-Usage">Basic Usage</a>, where we call <code>sample1 *.h</code>). You can
1415
1438
specify an optional description for these additional names (default is
1416
1439
<code>FILES</code>).
1417
1440
 
1418
 
     <br><dt><code>--no-handle-help</code><dt><code>--no-handle-version</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002dhelp_007d-79"></a><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002dversion_007d-80"></a>if <code>--no-handle-help</code> (<code>--no-handle-version</code>) is given the
 
1441
     <br><dt><code>--no-handle-help</code><dt><code>--no-handle-version</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002dhelp_007d-80"></a><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002dversion_007d-81"></a>if <code>--no-handle-help</code> (<code>--no-handle-version</code>) is given the
1419
1442
command line option <code>--help|-h</code> (<code>--version|-V</code>) is not
1420
1443
handled automatically, so the programmer will be able to print some
1421
1444
other information; then the function for printing the standard help
1433
1456
control on <code>--help|-h</code>, <code>--version|-V</code>, you should use the
1434
1457
following options:
1435
1458
 
1436
 
     <br><dt><code>--no-help</code><dt><code>--no-version</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhelp_007d-81"></a><a name="index-g_t_0040code_007b_002d_002dno_002dversion_007d-82"></a>With these options<a rel="footnote" href="#fn-31" name="fnd-31"><sup>31</sup></a> you can disable the
 
1459
     <br><dt><code>--no-help</code><dt><code>--no-version</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhelp_007d-82"></a><a name="index-g_t_0040code_007b_002d_002dno_002dversion_007d-83"></a>With these options<a rel="footnote" href="#fn-30" name="fnd-30"><sup>30</sup></a> you can disable the
1437
1460
automatic addition of options <code>--help|-h</code> and <code>--version|-V</code>,
1438
1461
respectively.  The programmer will then be able to add these options in
1439
1462
the input file and handle them as he sees fit.  Notice that
1447
1470
<samp><span class="file">test_manual_help_cmd.ggo</span></samp> and <samp><span class="file">test_manual_help.c</span></samp> in the
1448
1471
<samp><span class="file">examples</span></samp> directory.
1449
1472
 
1450
 
     <br><dt><code>--no-handle-error</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002derror_007d-83"></a>if <code>--no-handle-error</code> is given, an error in the parsing does not
 
1473
     <br><dt><code>--no-handle-error</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhandle_002derror_007d-84"></a>if <code>--no-handle-error</code> is given, an error in the parsing does not
1451
1474
provoke the exit of the program; instead, since the parser function, in
1452
1475
case of an error, returns a value different 0, the program can print a
1453
1476
help message, as gengetopt itself does in case of an error (try it!).
1454
1477
 
1455
 
     <br><dt><code>--show-required</code><dd><a name="index-g_t_0040code_007b_002d_002dshow_002drequired_007d-84"></a>if <code>--show-required</code> is given, possibly with
 
1478
     <br><dt><code>--show-required</code><dd><a name="index-g_t_0040code_007b_002d_002dshow_002drequired_007d-85"></a>if <code>--show-required</code> is given, possibly with
1456
1479
a string, in the output of <code>--help</code> will be made explicit
1457
1480
which options are actually required, See <a href="#showrequired">Basic Usage</a>.
1458
1481
 
1459
 
     <br><dt><code>--gen-version</code><dd><a name="index-g_t_0040code_007b_002d_002dgen_002dversion_007d-85"></a>is a flag (default on) that when disabled does not put in the output
 
1482
     <br><dt><code>--strict-hidden</code><dd>when given, this causes hidden options to become <em>really</em> hidden. 
 
1483
That is to say, the <code>--full-help</code> option will not be added, and
 
1484
hidden options will not show-up in the output of
 
1485
<code>--detailed-help</code>, even if they have details. 
 
1486
See <a href="#hidden">Hidden options</a>.
 
1487
 
 
1488
     <br><dt><code>--gen-version</code><dd><a name="index-g_t_0040code_007b_002d_002dgen_002dversion_007d-86"></a>is a flag (default on) that when disabled does not put in the output
1460
1489
file the gengetopt version (it is useful for testing purposes).
1461
1490
 
1462
 
     <br><dt><code>--conf-parser</code><dd><a name="index-g_t_0040code_007b_002d_002dconf_002dparser_007d-86"></a>Detailed in <a href="#Configuration-files">Configuration files</a>.
1463
 
 
1464
 
     <br><dt><code>--string-parser</code><dd><a name="index-g_t_0040code_007b_002d_002dstring_002dparser_007d-87"></a>Detailed in <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a>.
1465
 
 
1466
 
     <br><dt><code>--include-getopt</code><dd><a name="index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-88"></a>Adds the code for <code>getopt_long</code> into the generated parser C file. 
 
1491
     <br><dt><code>--conf-parser</code><dd><a name="index-g_t_0040code_007b_002d_002dconf_002dparser_007d-87"></a>Detailed in <a href="#Configuration-files">Configuration files</a>.
 
1492
 
 
1493
     <br><dt><code>--string-parser</code><dd><a name="index-g_t_0040code_007b_002d_002dstring_002dparser_007d-88"></a>Detailed in <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a>.
 
1494
 
 
1495
     <br><dt><code>--include-getopt</code><dd><a name="index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-89"></a>Adds the code for <code>getopt_long</code> into the generated parser C file. 
1467
1496
This will make your generated parser much bigger, but it will be
1468
1497
compiled in any system, even if <code>getopt_long</code> is not part of the C
1469
1498
library where your program is being compiled.  See also <a href="#No-getopt_005flong">No getopt_long</a>.
1470
1499
 
1471
 
     <br><dt><code>--show-help</code><dt><code>--show-full-help</code><dt><code>--show-version</code><dd><a name="index-g_t_0040code_007b_002d_002dshow_002dhelp_007d-89"></a><a name="index-g_t_0040code_007b_002d_002dshow_002dfull_002dhelp_007d-90"></a><a name="index-g_t_0040code_007b_002d_002dshow_002dversion_007d-91"></a>only make gengetopt show the output of <code>--help</code>,
 
1500
     <br><dt><code>--show-help</code><dt><code>--show-full-help</code><dt><code>--show-version</code><dd><a name="index-g_t_0040code_007b_002d_002dshow_002dhelp_007d-90"></a><a name="index-g_t_0040code_007b_002d_002dshow_002dfull_002dhelp_007d-91"></a><a name="index-g_t_0040code_007b_002d_002dshow_002dversion_007d-92"></a>only make gengetopt show the output of <code>--help</code>,
1472
1501
<code>--full-help</code> and <code>--version</code> command lines without
1473
1502
generating any code, See <a href="#addedoptions">Automatically added options</a>. 
1474
1503
For instance, I use the <code>--show-help</code> option to generate a
1510
1539
 
1511
1540
<h2 class="chapter">4 Terminology</h2>
1512
1541
 
1513
 
<p><a name="index-Terminology-92"></a><a name="index-argument_002c-defined-93"></a><a name="index-option_002c-defined-94"></a><a name="index-value_002c-defined-95"></a><a name="index-parameter_002c-defined-96"></a><a name="index-short-option_002c-defined-97"></a><a name="index-long-option_002c-defined-98"></a><a name="index-multiple-option_002c-defined-99"></a><a name="index-required-option_002c-defined-100"></a>
 
1542
<p><a name="index-Terminology-93"></a><a name="index-argument_002c-defined-94"></a><a name="index-option_002c-defined-95"></a><a name="index-value_002c-defined-96"></a><a name="index-parameter_002c-defined-97"></a><a name="index-short-option_002c-defined-98"></a><a name="index-long-option_002c-defined-99"></a><a name="index-multiple-option_002c-defined-100"></a><a name="index-required-option_002c-defined-101"></a>
1514
1543
An <dfn>argument</dfn> is an element of the <code>argv</code> array passed into
1515
1544
your C or C++ program by your operating system.
1516
1545
 
1651
1680
 
1652
1681
<h2 class="chapter">5 Options with enumerated values</h2>
1653
1682
 
1654
 
<p><a name="index-enumerated-options-101"></a><a name="index-values-102"></a>You can also specify the list of <code>values</code> that can be passed to an
 
1683
<p><a name="index-enumerated-options-102"></a><a name="index-values-103"></a>You can also specify the list of <code>values</code> that can be passed to an
1655
1684
option (if the type is not specified, the option has type
1656
1685
<code>string</code>).  If a value that is not in the list is passed, an error
1657
1686
is raised.  You can think of such options as <em>enumerated</em> options. 
1677
1706
<code>&lt;parser-name&gt;_&lt;option&gt;_values</code>, will be generated that contains
1678
1707
all the strings representing the possible accepted values.
1679
1708
 
1680
 
   <p><a name="index-enum-103"></a>An option with enumerated values can also be given the type <code>enum</code>;
 
1709
   <p><a name="index-enum-104"></a>An option with enumerated values can also be given the type <code>enum</code>;
1681
1710
in that case, a C <code>enum</code> type is also generated with name
1682
1711
<code>enum_&lt;option&gt;</code>; the values of such C enum will be generated
1683
1712
according this pattern: <code>&lt;option&gt;_arg_&lt;value&gt;</code>, where <code>value</code>
1722
1751
 
1723
1752
<h2 class="chapter">6 Group options</h2>
1724
1753
 
1725
 
<p><a name="index-group-options-104"></a>
 
1754
<p><a name="index-group-options-105"></a>
1726
1755
It is also possible to group options; options belonging to a <em>group</em> are
1727
1756
considered <em>in mutual exclusion</em>.  In order to use this feature, first the
1728
1757
<code>group</code> has to be defined, and then a <code>groupoption</code> can be defined.  A
1729
1758
groupoption has basically the same syntax of a standard option, apart
1730
1759
that the required flag must not be specified (it would not make sense,
1731
 
since the options of the same group are mutual exclusive) and the group
 
1760
since the options of the same group are mutually exclusive) and the group
1732
1761
to which the option belongs has to be specified.
1733
1762
 
1734
1763
<pre class="example">     defgroup "&lt;group name&gt;" {groupdesc="&lt;group description&gt;"} {required}
1774
1803
 
1775
1804
<h2 class="chapter">7 Mode options</h2>
1776
1805
 
1777
 
<p><a name="index-mode-options-105"></a>
 
1806
<p><a name="index-mode-options-106"></a>
1778
1807
It is also possible to specify &ldquo;mode options&rdquo;; options belonging to a
1779
1808
<em>mode</em> are considered <em>in mutual exclusion</em> with options of a
1780
1809
different mode.  Thus, you can specify more options belonging to the
1892
1921
      Mode: mode1
1893
1922
       any option of this mode is in contrast with any option of the other mode
1894
1923
       Notice that this description is quite long so it may spawn many lines...
1895
 
               fortunately gengetopt will wrap it for you :-)
 
1924
       fortunately gengetopt will wrap it for you :-)
1896
1925
       -a, --opta              string a
1897
1926
       -A, --optA[=STRING]     string A
1898
1927
       -M, --optAmul[=STRING]  string M
1916
1945
 
1917
1946
<h2 class="chapter">8 Parser function additional parameters</h2>
1918
1947
 
1919
 
<p><a name="index-parser-parameters-106"></a><a name="index-parameters-107"></a>
 
1948
<p><a name="index-parser-parameters-107"></a><a name="index-parameters-108"></a>
1920
1949
Besides the parser functions, in the generated header file, gengetopt
1921
 
also generates<a rel="footnote" href="#fn-32" name="fnd-32"><sup>32</sup></a> an additional structure
 
1950
also generates<a rel="footnote" href="#fn-31" name="fnd-31"><sup>31</sup></a> an additional structure
1922
1951
<code>&lt;cmd_parser_name&gt;_params</code> that can be used to customize the
1923
1952
invocation of the generated parsers (it is especially useful when using
1924
1953
configuration file parsers, <a href="#Configuration-files">Configuration files</a>, string parsers,
1930
1959
<code>1</code> and <code>false</code> if they are set to <code>0</code>):
1931
1960
 
1932
1961
     <dl>
1933
 
<dt><code>int initialize (default = 1)</code><dd><a name="index-initialize-108"></a>tells whether the args_info struct has to be initialized.
 
1962
<dt><code>int initialize (default = 1)</code><dd><a name="index-initialize-109"></a>tells whether the args_info struct has to be initialized.
1934
1963
 
1935
 
     <br><dt><code>int override (default = 0)</code><dd><a name="index-override-109"></a>tells whether the values for the options that are parsed should override
 
1964
     <br><dt><code>int override (default = 0)</code><dd><a name="index-override-110"></a>tells whether the values for the options that are parsed should override
1936
1965
those that are already present in the passed args_info struct (e.g.,
1937
1966
this is the case when you call a parser multiple times using the same
1938
1967
args_info struct, see, e.g., <a href="#Configuration-files">Configuration files</a> and<a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a>).
1939
1968
 
1940
 
     <br><dt><code>int check_required (default = 1)</code><dd><a name="index-check_005frequired-110"></a>tells whether the check for required options must be performed or not.
 
1969
     <br><dt><code>int check_required (default = 1)</code><dd><a name="index-check_005frequired-111"></a>tells whether the check for required options must be performed or not.
1941
1970
 
1942
 
     <br><dt><code>int check_ambiguity (default = 0)</code><dd><a name="index-check_005fambiguity-111"></a>tells whether the check whether options that are parsed are not
 
1971
     <br><dt><code>int check_ambiguity (default = 0)</code><dd><a name="index-check_005fambiguity-112"></a>tells whether the check whether options that are parsed are not
1943
1972
already present in the passed args_info struct; this is performed only
1944
1973
for NON multiple options (see also <a href="#Multiple-Options">Multiple Options</a>).
1945
1974
 
1946
 
     <br><dt><code>int print_errors (default = 1)</code><dd><a name="index-print_005ferrors-112"></a>tells<a rel="footnote" href="#fn-33" name="fnd-33"><sup>33</sup></a> whether <code>getopt_long</code>
 
1975
     <br><dt><code>int print_errors (default = 1)</code><dd><a name="index-print_005ferrors-113"></a>tells<a rel="footnote" href="#fn-32" name="fnd-32"><sup>32</sup></a> whether <code>getopt_long</code>
1947
1976
must print error messages to the standard error stream if it encounters
1948
1977
an unknown option character or an option with a missing required
1949
1978
argument.  This is the default behavior.  If you set this variable to
1952
1981
</dl>
1953
1982
 
1954
1983
   <p>Gengetopt also generates an initialization function for such
1955
 
structures<a rel="footnote" href="#fn-34" name="fnd-34"><sup>34</sup></a>, called <code>&lt;cmd_parser_name&gt;_params_init</code>,
 
1984
structures<a rel="footnote" href="#fn-33" name="fnd-33"><sup>33</sup></a>, called <code>&lt;cmd_parser_name&gt;_params_init</code>,
1956
1985
which takes as argument a pointer to such structure and initialize all
1957
1986
its fields to their default values; it also generates a function called
1958
1987
<code>&lt;cmd_parser_name&gt;_params_create</code> that returns a dynamically
1981
2010
 
1982
2011
<h2 class="chapter">9 Configuration files</h2>
1983
2012
 
1984
 
<p><a name="index-configuration-files-113"></a>
1985
 
<a name="index-g_t_0040code_007b_002dC_002c_002d_002dconf_002dparser_007d-114"></a>It is often useful to specify command line options directly in a
 
2013
<p><a name="index-configuration-files-114"></a>
 
2014
<a name="index-g_t_0040code_007b_002dC_002c_002d_002dconf_002dparser_007d-115"></a>It is often useful to specify command line options directly in a
1986
2015
configuration file, so that the value of some options are read from this
1987
2016
file if they are not given as command line options.  When the command
1988
2017
line option <code>-C|--conf-parser</code> is given to gengetopt, apart from
1989
2018
the standard command line option parser, also this additional parser is
1990
 
generated (its name is <code>&lt;cmd_parser_name&gt;_config_file</code><a rel="footnote" href="#fn-35" name="fnd-35"><sup>35</sup></a>):
 
2019
generated (its name is <code>&lt;cmd_parser_name&gt;_config_file</code><a rel="footnote" href="#fn-34" name="fnd-34"><sup>34</sup></a>):
1991
2020
 
1992
 
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005fconfig_005ffile-115"></a>
 
2021
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005fconfig_005ffile-116"></a>
1993
2022
<pre class="example">     int
1994
2023
     &lt;cmd_parser_name&gt;_config_file(char * const filename,
1995
2024
                                  struct gengetopt_args_info *args_info,
2008
2037
option parser and then you want to call the standard command line parser
2009
2038
you MUST use this second version of the parser function, with
2010
2039
<code>params-&gt;initialize</code> set to 0, so that collected values from the
2011
 
config file are not lost<a rel="footnote" href="#fn-36" name="fnd-36"><sup>36</sup></a>:
 
2040
config file are not lost<a rel="footnote" href="#fn-35" name="fnd-35"><sup>35</sup></a>:
2012
2041
 
2013
 
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005fext-116"></a>
 
2042
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005fext-117"></a>
2014
2043
<pre class="example">     int
2015
2044
     &lt;cmd_parser_name&gt;_ext (int argc,
2016
2045
                            char **argv,
2031
2060
test it manually, after the command line parsing returns by using the
2032
2061
following generated function:
2033
2062
 
2034
 
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005frequired-117"></a>
 
2063
   <p><a name="index-g_t_003ccmd_005fparser_005fname_003e_005frequired-118"></a>
2035
2064
<pre class="example">     int
2036
2065
     &lt;cmd_parser_name&gt;_required (struct gengetopt_args_info *args_info,
2037
2066
                                 const char *program_name);
2054
2083
   <p class="noindent">which means that <code>option_name</code> is given, and if it accepts an argument,
2055
2084
then its value is <code>option_val</code>.  The <code>=</code> is not mandatory.
2056
2085
 
2057
 
   <p><a name="index-include-118"></a>Since version 2.19, it is possible to include other files (i.e., other
 
2086
   <p><a name="index-include-119"></a>Since version 2.19, it is possible to include other files (i.e., other
2058
2087
configuration files) in a configuration file, by using the
2059
2088
<code>include</code> syntax:
2060
2089
 
2068
2097
     
2069
2098
     <i>/* test all kinds of options and the conf file parser */</i>
2070
2099
     
 
2100
     <b>#ifdef</b> HAVE_CONFIG_H
 
2101
     <b>#include</b> <tt>"config.h"</tt>
 
2102
     <b>#endif</b>
 
2103
     
2071
2104
     <b>#include</b> <tt>&lt;stdlib.h&gt;</tt>
2072
2105
     <b>#include</b> <tt>&lt;stdio.h&gt;</tt>
2073
2106
     
2191
2224
     <i>/* differently from test_conf_parser_ov.c, first scan the conf file and</i>
2192
2225
     <i>   then the command line */</i>
2193
2226
     
 
2227
     <b>#ifdef</b> HAVE_CONFIG_H
 
2228
     <b>#include</b> <tt>"config.h"</tt>
 
2229
     <b>#endif</b>
 
2230
     
2194
2231
     <b>#include</b> <tt>&lt;stdlib.h&gt;</tt>
2195
2232
     <b>#include</b> <tt>&lt;stdio.h&gt;</tt>
2196
2233
     
2284
2321
 
2285
2322
<h2 class="chapter">10 Multiple Options</h2>
2286
2323
 
2287
 
<p><a name="index-multiple-options-119"></a>
 
2324
<p><a name="index-multiple-options-120"></a>
2288
2325
If an option is specified as <code>multiple</code>, then it can be specified
2289
2326
multiple times at command line.  In this case, say the option is
2290
2327
called <code>foo</code>, the generated <code>foo_given</code> field in the args
2322
2359
<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
2323
2360
<pre class="example">     <i>/* test options that can be given more than once */</i>
2324
2361
     
 
2362
     <b>#ifdef</b> HAVE_CONFIG_H
 
2363
     <b>#include</b> <tt>"config.h"</tt>
 
2364
     <b>#endif</b>
 
2365
     
2325
2366
     <b>#include</b> <tt>&lt;stdlib.h&gt;</tt>
2326
2367
     <b>#include</b> <tt>&lt;stdio.h&gt;</tt>
2327
2368
     
2401
2442
 
2402
2443
<h2 class="chapter">11 String Parsers and Multiple Parsers</h2>
2403
2444
 
2404
 
<p><a name="index-multiple-parsers-120"></a><a name="index-string-parsers-121"></a>
 
2445
<p><a name="index-multiple-parsers-121"></a><a name="index-string-parsers-122"></a>
2405
2446
The parsers generated by gengetopt (indeed the C and header files) are
2406
2447
self-contained and different parsers can be linked in the same program,
2407
2448
without interferences.  This is useful, e.g., in cases where a specific
2417
2458
line parsers is likely to generate errors: the different command line
2418
2459
parsers are likely to have different syntaxes for accepted options.
2419
2460
 
2420
 
   <p><a name="index-g_t_0040code_007b_002dS_002c_002d_002dstring_002dparser_007d-122"></a>For this reason gengetopt can generate parser functions that take a
 
2461
   <p><a name="index-g_t_0040code_007b_002dS_002c_002d_002dstring_002dparser_007d-123"></a>For this reason gengetopt can generate parser functions that take a
2421
2462
string containing the further options to parse, instead of taking an
2422
2463
array.  This additional parser will have the parser name and the
2423
2464
suffix <code>_string</code>.  If you want these additional parsers to be
2433
2474
         const char *prog_name,
2434
2475
         struct &lt;cmd_parser_name&gt;_params *params);
2435
2476
</pre>
2436
 
   <p>The second version<a rel="footnote" href="#fn-37" name="fnd-37"><sup>37</sup></a> allows you to specify more details about the
 
2477
   <p>The second version<a rel="footnote" href="#fn-36" name="fnd-36"><sup>36</sup></a> allows you to specify more details about the
2437
2478
parsing, using the <code>&lt;cmd_parser_name&gt;_params</code> structure, shown in
2438
2479
<a href="#Parser-function-additional-parameters">Parser function additional parameters</a> (this is the same as for
2439
2480
configuration files, thus we refer to that section for the details of
2494
2535
file:
2495
2536
 
2496
2537
<!-- Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite -->
2497
 
<pre class="example">     <b>#include</b> <tt>&lt;stdio.h&gt;</tt>
 
2538
<pre class="example">     <b>#ifdef</b> HAVE_CONFIG_H
 
2539
     <b>#include</b> <tt>"config.h"</tt>
 
2540
     <b>#endif</b>
 
2541
     
 
2542
     <b>#include</b> <tt>&lt;stdio.h&gt;</tt>
2498
2543
     <b>#include</b> <tt>&lt;stdlib.h&gt;</tt>
2499
2544
     
2500
2545
     <b>#include</b> <tt>"test_main_cmdline_cmd.h"</tt>
2595
2640
 
2596
2641
<h2 class="chapter">12 What if getopt_long is not available?</h2>
2597
2642
 
2598
 
<p><a name="index-getopt_005flong-123"></a>
 
2643
<p><a name="index-getopt_005flong-124"></a>
2599
2644
If you use gengetopt to generate C functions for parsing command line
2600
2645
arguments you have to know that these generated functions use
2601
2646
<code>getopt_long</code> to actually read the command line and parsing it. 
2626
2671
used to actually parse the command line arguments, instead of that taken
2627
2672
from the C library.
2628
2673
 
2629
 
   <p><a name="index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-124"></a>This solution is actually quite easy, since you only need to specify the
 
2674
   <p><a name="index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-125"></a>This solution is actually quite easy, since you only need to specify the
2630
2675
command line option <code>--include-getopt</code> (see <a href="#Invoking-gengetopt">Invoking gengetopt</a>), but it has two main drawbacks:
2631
2676
 
2632
2677
     <ul>
2656
2701
 
2657
2702
<h3 class="section">12.2 Use automake/autoconf to check for the existence of <code>getopt_long</code></h3>
2658
2703
 
2659
 
<p><a name="index-automake-125"></a><a name="index-autoconf-126"></a>Autoconf and Automake are great tools to generate a configure script
 
2704
<p><a name="index-automake-126"></a><a name="index-autoconf-127"></a>Autoconf and Automake are great tools to generate a configure script
2660
2705
that automatically checks for the configuration of your system and for
2661
2706
possible missing functions required to compile your program.  However,
2662
2707
in case of detected missing functions, your program must be able to
2681
2726
 
2682
2727
<h4 class="subsection">12.2.1 Use Gnulib</h4>
2683
2728
 
2684
 
<p><a name="index-gnulib-127"></a>Since version 2.19 I also started to use Gnulib - The GNU Portability
2685
 
Library<a rel="footnote" href="#fn-38" name="fnd-38"><sup>38</sup></a>, &ldquo;a central
 
2729
<p><a name="index-gnulib-128"></a>Since version 2.19 I also started to use Gnulib - The GNU Portability
 
2730
Library<a rel="footnote" href="#fn-37" name="fnd-37"><sup>37</sup></a>, &ldquo;a central
2686
2731
location for common GNU code, intended to be shared among GNU
2687
2732
packages&rdquo;.  Gnulib provides an easy and smooth way to add to your
2688
2733
package sources the sources of functions that you want to check during
2794
2839
2.18.  We suggest now to use the procedure described in <a href="#Use-Gnulib">Use Gnulib</a>, since the files described in the following might not be kept
2795
2840
up-to-date.
2796
2841
 
2797
 
   <p><a name="index-automake-128"></a><a name="index-autoconf-129"></a>We provide C files that actually implement <code>getopt_long</code> function:
 
2842
   <p><a name="index-automake-129"></a><a name="index-autoconf-130"></a>We provide C files that actually implement <code>getopt_long</code> function:
2798
2843
<samp><span class="file">getopt.c</span></samp> <samp><span class="file">getopt1.c</span></samp> and <samp><span class="file">gnugetopt.h</span></samp>.   You'll find
2799
2844
these files in the <samp><span class="file">&lt;install prefix&gt;/share/gengetopt</span></samp> directory
2800
2845
where <samp><span class="file">&lt;install prefix&gt;</span></samp> is the one you specified during
2848
2893
 
2849
2894
<h2 class="chapter">13 Known Bugs and Limitations</h2>
2850
2895
 
2851
 
<p><a name="index-Known-Bugs-130"></a><a name="index-Limits-131"></a><a name="index-Misfeatures-132"></a>
 
2896
<p><a name="index-Known-Bugs-131"></a><a name="index-Limits-132"></a><a name="index-Misfeatures-133"></a>
2852
2897
If you find a bug in <samp><span class="command">gengetopt</span></samp>, please use the Savannah web
2853
2898
interface
2854
2899
 
2884
2929
memory in a bad way leading to crashes or unexpected behaviors.  This
2885
2930
happens because it keeps pointers to locations of the previous arrays
2886
2931
if not initialized each time by setting <code>optind =
2887
 
0</code><a rel="footnote" href="#fn-39" name="fnd-39"><sup>39</sup></a>. 
 
2932
0</code><a rel="footnote" href="#fn-38" name="fnd-38"><sup>38</sup></a>. 
2888
2933
Unfortunately this initialization behavior seems to be part only of
2889
2934
the implementation of GNU library and actually it is not documented
2890
2935
(you can see it by taking a look into the source of <samp><span class="file">getopt.c</span></samp>);
2920
2965
 
2921
2966
<h2 class="chapter">14 Mailing Lists</h2>
2922
2967
 
2923
 
<p><a name="index-mailing-list-133"></a>
 
2968
<p><a name="index-mailing-list-134"></a>
2924
2969
The following mailing lists are available:
2925
2970
 
2926
2971
   <p><code>help-gengetopt at gnu dot org</code>
2954
2999
<h2 class="unnumbered">Index</h2>
2955
3000
 
2956
3001
<ul class="index-cp" compact>
2957
 
<li><a href="#index-g_t_0040code_007b_002d_002darg_002dstruct_002dname_007d-75"><code>--arg-struct-name</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2958
 
<li><a href="#index-g_t_0040code_007b_002d_002dconf_002dparser_007d-86"><code>--conf-parser</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2959
 
<li><a href="#index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-77"><code>--default-optional</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2960
 
<li><a href="#index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-46"><code>--default-optional</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2961
 
<li><a href="#index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-38"><code>--detailed-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2962
 
<li><a href="#index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-51"><code>--full-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2963
 
<li><a href="#index-g_t_0040code_007b_002d_002dfunc_002dname_007d-71"><code>--func-name</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2964
 
<li><a href="#index-g_t_0040code_007b_002d_002dgen_002dversion_007d-85"><code>--gen-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2965
 
<li><a href="#index-g_t_0040code_007b_002d_002dheader_002doutput_002ddir_007d-74"><code>--header-output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2966
 
<li><a href="#index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-124"><code>--include-getopt</code></a>: <a href="#Include-the-getopt_005flong-code-into-the-parser">Include the getopt_long code into the parser</a></li>
2967
 
<li><a href="#index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-88"><code>--include-getopt</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2968
 
<li><a href="#index-g_t_0040code_007b_002d_002dlong_002dhelp_007d-76"><code>--long-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2969
 
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002derror_007d-83"><code>--no-handle-error</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2970
 
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002dhelp_007d-79"><code>--no-handle-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2971
 
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002dversion_007d-80"><code>--no-handle-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2972
 
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhelp_007d-81"><code>--no-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2973
 
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dversion_007d-82"><code>--no-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2974
 
<li><a href="#index-g_t_0040code_007b_002d_002doutput_002ddir_007d-72"><code>--output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2975
 
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dfull_002dhelp_007d-90"><code>--show-full-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2976
 
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dhelp_007d-89"><code>--show-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2977
 
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002drequired_007d-84"><code>--show-required</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2978
 
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dversion_007d-91"><code>--show-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2979
 
<li><a href="#index-g_t_0040code_007b_002d_002dsrc_002doutput_002ddir_007d-73"><code>--src-output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2980
 
<li><a href="#index-g_t_0040code_007b_002d_002dstring_002dparser_007d-87"><code>--string-parser</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2981
 
<li><a href="#index-g_t_0040code_007b_002d_002dunamed_002dopts_007d-78"><code>--unamed-opts</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
2982
 
<li><a href="#index-g_t_0040code_007b_002dC_002c_002d_002dconf_002dparser_007d-114"><code>-C,--conf-parser</code></a>: <a href="#Configuration-files">Configuration files</a></li>
2983
 
<li><a href="#index-g_t_0040code_007b_002dh_002c_002d_002ddetailed_002dhelp_007d-68"><code>-h,--detailed-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2984
 
<li><a href="#index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-54"><code>-h,--help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2985
 
<li><a href="#index-g_t_0040code_007b_002dS_002c_002d_002dstring_002dparser_007d-122"><code>-S,--string-parser</code></a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
2986
 
<li><a href="#index-g_t_0040code_007b_002dV_002c_002d_002dversion_007d-55"><code>-V,--version</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
2987
 
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005fconfig_005ffile-115">&lt;cmd_parser_name&gt;_config_file</a>: <a href="#Configuration-files">Configuration files</a></li>
2988
 
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005fext-116">&lt;cmd_parser_name&gt;_ext</a>: <a href="#Configuration-files">Configuration files</a></li>
2989
 
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005frequired-117">&lt;cmd_parser_name&gt;_required</a>: <a href="#Configuration-files">Configuration files</a></li>
2990
 
<li><a href="#index-argoptional-47">argoptional</a>: <a href="#Basic-Usage">Basic Usage</a></li>
2991
 
<li><a href="#index-args-32">args</a>: <a href="#Basic-Usage">Basic Usage</a></li>
2992
 
<li><a href="#index-argtype-39">argtype</a>: <a href="#Basic-Usage">Basic Usage</a></li>
2993
 
<li><a href="#index-argument_002c-defined-93">argument, defined</a>: <a href="#Terminology">Terminology</a></li>
2994
 
<li><a href="#index-argv-62">argv</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3002
<li><a href="#index-g_t_0040code_007b_002d_002darg_002dstruct_002dname_007d-76"><code>--arg-struct-name</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3003
<li><a href="#index-g_t_0040code_007b_002d_002dconf_002dparser_007d-87"><code>--conf-parser</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3004
<li><a href="#index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-78"><code>--default-optional</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3005
<li><a href="#index-g_t_0040code_007b_002d_002ddefault_002doptional_007d-47"><code>--default-optional</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3006
<li><a href="#index-g_t_0040code_007b_002d_002ddetailed_002dhelp_007d-39"><code>--detailed-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3007
<li><a href="#index-g_t_0040code_007b_002d_002dfull_002dhelp_007d-52"><code>--full-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3008
<li><a href="#index-g_t_0040code_007b_002d_002dfunc_002dname_007d-72"><code>--func-name</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3009
<li><a href="#index-g_t_0040code_007b_002d_002dgen_002dversion_007d-86"><code>--gen-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3010
<li><a href="#index-g_t_0040code_007b_002d_002dheader_002doutput_002ddir_007d-75"><code>--header-output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3011
<li><a href="#index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-125"><code>--include-getopt</code></a>: <a href="#Include-the-getopt_005flong-code-into-the-parser">Include the getopt_long code into the parser</a></li>
 
3012
<li><a href="#index-g_t_0040code_007b_002d_002dinclude_002dgetopt_007d-89"><code>--include-getopt</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3013
<li><a href="#index-g_t_0040code_007b_002d_002dlong_002dhelp_007d-77"><code>--long-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3014
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002derror_007d-84"><code>--no-handle-error</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3015
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002dhelp_007d-80"><code>--no-handle-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3016
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhandle_002dversion_007d-81"><code>--no-handle-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3017
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dhelp_007d-82"><code>--no-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3018
<li><a href="#index-g_t_0040code_007b_002d_002dno_002dversion_007d-83"><code>--no-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3019
<li><a href="#index-g_t_0040code_007b_002d_002doutput_002ddir_007d-73"><code>--output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3020
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dfull_002dhelp_007d-91"><code>--show-full-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3021
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dhelp_007d-90"><code>--show-help</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3022
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002drequired_007d-85"><code>--show-required</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3023
<li><a href="#index-g_t_0040code_007b_002d_002dshow_002dversion_007d-92"><code>--show-version</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3024
<li><a href="#index-g_t_0040code_007b_002d_002dsrc_002doutput_002ddir_007d-74"><code>--src-output-dir</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3025
<li><a href="#index-g_t_0040code_007b_002d_002dstring_002dparser_007d-88"><code>--string-parser</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3026
<li><a href="#index-g_t_0040code_007b_002d_002dunamed_002dopts_007d-79"><code>--unamed-opts</code></a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3027
<li><a href="#index-g_t_0040code_007b_002dC_002c_002d_002dconf_002dparser_007d-115"><code>-C,--conf-parser</code></a>: <a href="#Configuration-files">Configuration files</a></li>
 
3028
<li><a href="#index-g_t_0040code_007b_002dh_002c_002d_002ddetailed_002dhelp_007d-69"><code>-h,--detailed-help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3029
<li><a href="#index-g_t_0040code_007b_002dh_002c_002d_002dhelp_007d-55"><code>-h,--help</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3030
<li><a href="#index-g_t_0040code_007b_002dS_002c_002d_002dstring_002dparser_007d-123"><code>-S,--string-parser</code></a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
 
3031
<li><a href="#index-g_t_0040code_007b_002dV_002c_002d_002dversion_007d-56"><code>-V,--version</code></a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3032
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005fconfig_005ffile-116">&lt;cmd_parser_name&gt;_config_file</a>: <a href="#Configuration-files">Configuration files</a></li>
 
3033
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005fext-117">&lt;cmd_parser_name&gt;_ext</a>: <a href="#Configuration-files">Configuration files</a></li>
 
3034
<li><a href="#index-g_t_003ccmd_005fparser_005fname_003e_005frequired-118">&lt;cmd_parser_name&gt;_required</a>: <a href="#Configuration-files">Configuration files</a></li>
 
3035
<li><a href="#index-argoptional-48">argoptional</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3036
<li><a href="#index-args-33">args</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3037
<li><a href="#index-argtype-40">argtype</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3038
<li><a href="#index-argument_002c-defined-94">argument, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3039
<li><a href="#index-argv-63">argv</a>: <a href="#Basic-Usage">Basic Usage</a></li>
2995
3040
<li><a href="#index-Audience-1">Audience</a>: <a href="#Audience">Audience</a></li>
2996
 
<li><a href="#index-autoconf-129">autoconf</a>: <a href="#Use-getopt_005flong-sources">Use getopt_long sources</a></li>
2997
 
<li><a href="#index-autoconf-126">autoconf</a>: <a href="#Use-automake_002fautoconf">Use automake/autoconf</a></li>
 
3041
<li><a href="#index-autoconf-130">autoconf</a>: <a href="#Use-getopt_005flong-sources">Use getopt_long sources</a></li>
 
3042
<li><a href="#index-autoconf-127">autoconf</a>: <a href="#Use-automake_002fautoconf">Use automake/autoconf</a></li>
2998
3043
<li><a href="#index-autoconf-13">autoconf</a>: <a href="#Installation">Installation</a></li>
2999
 
<li><a href="#index-automake-128">automake</a>: <a href="#Use-getopt_005flong-sources">Use getopt_long sources</a></li>
3000
 
<li><a href="#index-automake-125">automake</a>: <a href="#Use-automake_002fautoconf">Use automake/autoconf</a></li>
 
3044
<li><a href="#index-automake-129">automake</a>: <a href="#Use-getopt_005flong-sources">Use getopt_long sources</a></li>
 
3045
<li><a href="#index-automake-126">automake</a>: <a href="#Use-automake_002fautoconf">Use automake/autoconf</a></li>
3001
3046
<li><a href="#index-automake-12">automake</a>: <a href="#Installation">Installation</a></li>
3002
 
<li><a href="#index-check_005fambiguity-111">check_ambiguity</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3003
 
<li><a href="#index-check_005frequired-110">check_required</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3047
<li><a href="#index-check_005fambiguity-112">check_ambiguity</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3048
<li><a href="#index-check_005frequired-111">check_required</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3004
3049
<li><a href="#index-Conditions-for-copying-Gengetopt-7">Conditions for copying Gengetopt</a>: <a href="#Copying">Copying</a></li>
3005
 
<li><a href="#index-configuration-files-113">configuration files</a>: <a href="#Configuration-files">Configuration files</a></li>
 
3050
<li><a href="#index-configuration-files-114">configuration files</a>: <a href="#Configuration-files">Configuration files</a></li>
3006
3051
<li><a href="#index-Copying-conditions-6">Copying conditions</a>: <a href="#Copying">Copying</a></li>
3007
 
<li><a href="#index-default-42">default</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3008
 
<li><a href="#index-dependon-43">dependon</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3009
 
<li><a href="#index-desc-35">desc</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3052
<li><a href="#index-default-43">default</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3053
<li><a href="#index-dependon-44">dependon</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3054
<li><a href="#index-desc-36">desc</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3010
3055
<li><a href="#index-description-31">description</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3011
 
<li><a href="#index-details-37">details</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3056
<li><a href="#index-details-38">details</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3012
3057
<li><a href="#index-download-9">download</a>: <a href="#Installation">Installation</a></li>
3013
 
<li><a href="#index-enum-103">enum</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
3014
 
<li><a href="#index-enumerated-options-101">enumerated options</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
3015
 
<li><a href="#index-gengetopt-options-70">gengetopt options</a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
3016
 
<li><a href="#index-getopt_005flong-123">getopt_long</a>: <a href="#No-getopt_005flong">No getopt_long</a></li>
 
3058
<li><a href="#index-enum-104">enum</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
 
3059
<li><a href="#index-enumerated-options-102">enumerated options</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
 
3060
<li><a href="#index-gengetopt-options-71">gengetopt options</a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3061
<li><a href="#index-getopt_005flong-124">getopt_long</a>: <a href="#No-getopt_005flong">No getopt_long</a></li>
3017
3062
<li><a href="#index-getting-started-with-Gengetopt-22">getting started with Gengetopt</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3018
3063
<li><a href="#index-Git-11">Git</a>: <a href="#Installation">Installation</a></li>
3019
 
<li><a href="#index-gnulib-127">gnulib</a>: <a href="#Use-Gnulib">Use Gnulib</a></li>
 
3064
<li><a href="#index-gnulib-128">gnulib</a>: <a href="#Use-Gnulib">Use Gnulib</a></li>
3020
3065
<li><a href="#index-gnulib-19">gnulib</a>: <a href="#Installation">Installation</a></li>
3021
 
<li><a href="#index-group-options-104">group options</a>: <a href="#Group-options">Group options</a></li>
3022
 
<li><a href="#index-hidden-49">hidden</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3066
<li><a href="#index-group-options-105">group options</a>: <a href="#Group-options">Group options</a></li>
 
3067
<li><a href="#index-hidden-50">hidden</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3023
3068
<li><a href="#index-how-to-use-Gengetopt-21">how to use Gengetopt</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3024
 
<li><a href="#index-include-118">include</a>: <a href="#Configuration-files">Configuration files</a></li>
3025
 
<li><a href="#index-initialize-108">initialize</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3069
<li><a href="#index-include-119">include</a>: <a href="#Configuration-files">Configuration files</a></li>
 
3070
<li><a href="#index-initialize-109">initialize</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3026
3071
<li><a href="#index-installation-8">installation</a>: <a href="#Installation">Installation</a></li>
3027
 
<li><a href="#index-invoking-69">invoking</a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
3028
 
<li><a href="#index-Known-Bugs-130">Known Bugs</a>: <a href="#Bugs">Bugs</a></li>
 
3072
<li><a href="#index-invoking-70">invoking</a>: <a href="#Invoking-gengetopt">Invoking gengetopt</a></li>
 
3073
<li><a href="#index-Known-Bugs-131">Known Bugs</a>: <a href="#Bugs">Bugs</a></li>
3029
3074
<li><a href="#index-libtool-14">libtool</a>: <a href="#Installation">Installation</a></li>
3030
 
<li><a href="#index-Limits-131">Limits</a>: <a href="#Bugs">Bugs</a></li>
3031
 
<li><a href="#index-long-33">long</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3032
 
<li><a href="#index-long-option_002c-defined-98">long option, defined</a>: <a href="#Terminology">Terminology</a></li>
3033
 
<li><a href="#index-mailing-list-133">mailing list</a>: <a href="#Mailing-Lists">Mailing Lists</a></li>
3034
 
<li><a href="#index-Misfeatures-132">Misfeatures</a>: <a href="#Bugs">Bugs</a></li>
3035
 
<li><a href="#index-mode-options-105">mode options</a>: <a href="#Mode-options">Mode options</a></li>
3036
 
<li><a href="#index-multiple-48">multiple</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3037
 
<li><a href="#index-multiple-option_002c-defined-99">multiple option, defined</a>: <a href="#Terminology">Terminology</a></li>
3038
 
<li><a href="#index-multiple-options-119">multiple options</a>: <a href="#Multiple-Options">Multiple Options</a></li>
3039
 
<li><a href="#index-multiple-parsers-120">multiple parsers</a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
3040
 
<li><a href="#index-on_002foff-53">on/off</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3041
 
<li><a href="#index-option-without-name-61">option without name</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3042
 
<li><a href="#index-option_002c-defined-94">option, defined</a>: <a href="#Terminology">Terminology</a></li>
3043
 
<li><a href="#index-optional-45">optional</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3044
 
<li><a href="#index-override-109">override</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3075
<li><a href="#index-Limits-132">Limits</a>: <a href="#Bugs">Bugs</a></li>
 
3076
<li><a href="#index-long-34">long</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3077
<li><a href="#index-long-option_002c-defined-99">long option, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3078
<li><a href="#index-mailing-list-134">mailing list</a>: <a href="#Mailing-Lists">Mailing Lists</a></li>
 
3079
<li><a href="#index-Misfeatures-133">Misfeatures</a>: <a href="#Bugs">Bugs</a></li>
 
3080
<li><a href="#index-mode-options-106">mode options</a>: <a href="#Mode-options">Mode options</a></li>
 
3081
<li><a href="#index-multiple-49">multiple</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3082
<li><a href="#index-multiple-option_002c-defined-100">multiple option, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3083
<li><a href="#index-multiple-options-120">multiple options</a>: <a href="#Multiple-Options">Multiple Options</a></li>
 
3084
<li><a href="#index-multiple-parsers-121">multiple parsers</a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
 
3085
<li><a href="#index-on_002foff-54">on/off</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3086
<li><a href="#index-option-without-name-62">option without name</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3087
<li><a href="#index-option_002c-defined-95">option, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3088
<li><a href="#index-optional-46">optional</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3089
<li><a href="#index-override-110">override</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3045
3090
<li><a href="#index-PACKAGE-25">PACKAGE</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3046
3091
<li><a href="#index-package-24">package</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3047
3092
<li><a href="#index-PACKAGE-3">PACKAGE</a>: <a href="#Audience">Audience</a></li>
3048
3093
<li><a href="#index-PACKAGE_005fNAME-26">PACKAGE_NAME</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3049
3094
<li><a href="#index-PACKAGE_005fNAME-4">PACKAGE_NAME</a>: <a href="#Audience">Audience</a></li>
3050
 
<li><a href="#index-parameter-60">parameter</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3051
 
<li><a href="#index-parameter_002c-defined-96">parameter, defined</a>: <a href="#Terminology">Terminology</a></li>
3052
 
<li><a href="#index-parameters-107">parameters</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3053
 
<li><a href="#index-parser-parameters-106">parser parameters</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3095
<li><a href="#index-parameter-61">parameter</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3096
<li><a href="#index-parameter_002c-defined-97">parameter, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3097
<li><a href="#index-parameters-108">parameters</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3098
<li><a href="#index-parser-parameters-107">parser parameters</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3054
3099
<li><a href="#index-patching-20">patching</a>: <a href="#Installation">Installation</a></li>
3055
 
<li><a href="#index-print_005ferrors-112">print_errors</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
 
3100
<li><a href="#index-print_005ferrors-113">print_errors</a>: <a href="#Parser-function-additional-parameters">Parser function additional parameters</a></li>
3056
3101
<li><a href="#index-purpose-29">purpose</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3057
 
<li><a href="#index-required-44">required</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3058
 
<li><a href="#index-required-option_002c-defined-100">required option, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3102
<li><a href="#index-required-45">required</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3103
<li><a href="#index-required-option_002c-defined-101">required option, defined</a>: <a href="#Terminology">Terminology</a></li>
3059
3104
<li><a href="#index-requirements-15">requirements</a>: <a href="#Installation">Installation</a></li>
3060
 
<li><a href="#index-section-58">section</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3061
 
<li><a href="#index-short-34">short</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3062
 
<li><a href="#index-short-option_002c-defined-97">short option, defined</a>: <a href="#Terminology">Terminology</a></li>
3063
 
<li><a href="#index-string-parsers-121">string parsers</a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
3064
 
<li><a href="#index-Terminology-92">Terminology</a>: <a href="#Terminology">Terminology</a></li>
3065
 
<li><a href="#index-text-59">text</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3105
<li><a href="#index-section-59">section</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3106
<li><a href="#index-short-35">short</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3107
<li><a href="#index-short-option_002c-defined-98">short option, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3108
<li><a href="#index-string-parsers-122">string parsers</a>: <a href="#String-Parsers-and-Multiple-Parsers">String Parsers and Multiple Parsers</a></li>
 
3109
<li><a href="#index-Terminology-93">Terminology</a>: <a href="#Terminology">Terminology</a></li>
 
3110
<li><a href="#index-text-60">text</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3066
3111
<li><a href="#index-tutorial-23">tutorial</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3067
 
<li><a href="#index-typestr-40">typestr</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3112
<li><a href="#index-typestr-41">typestr</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3068
3113
<li><a href="#index-usage-30">usage</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3069
 
<li><a href="#index-value_002c-defined-95">value, defined</a>: <a href="#Terminology">Terminology</a></li>
3070
 
<li><a href="#index-values-102">values</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
3071
 
<li><a href="#index-values-41">values</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3114
<li><a href="#index-value_002c-defined-96">value, defined</a>: <a href="#Terminology">Terminology</a></li>
 
3115
<li><a href="#index-values-103">values</a>: <a href="#Options-with-enumerated-values">Options with enumerated values</a></li>
 
3116
<li><a href="#index-values-42">values</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3072
3117
<li><a href="#index-VERSION-28">VERSION</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3073
3118
<li><a href="#index-version-27">version</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3074
3119
<li><a href="#index-VERSION-5">VERSION</a>: <a href="#Audience">Audience</a></li>
 
3120
<li><a href="#index-versiontext-32">versiontext</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3075
3121
<li><a href="#index-Who-should-use-Gengetopt-2">Who should use Gengetopt</a>: <a href="#Audience">Audience</a></li>
3076
 
<li><a href="#index-wrapping-36">wrapping</a>: <a href="#Basic-Usage">Basic Usage</a></li>
 
3122
<li><a href="#index-wrapping-37">wrapping</a>: <a href="#Basic-Usage">Basic Usage</a></li>
3077
3123
   </ul><div class="footnote">
3078
3124
<hr>
3079
3125
<a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> Since version 2.22.4 of Gengetopt the
3105
3151
 
3106
3152
   <p class="footnote"><small>[<a name="fn-13" href="#fnd-13">13</a>]</small> Since version 2.16.</p>
3107
3153
 
3108
 
   <p class="footnote"><small>[<a name="fn-14" href="#fnd-14">14</a>]</small> Since version 2.22.</p>
3109
 
 
3110
 
   <p class="footnote"><small>[<a name="fn-15" href="#fnd-15">15</a>]</small> This is true since version 2.19. Before this version,
 
3154
   <p class="footnote"><small>[<a name="fn-14" href="#fnd-14">14</a>]</small> This is true since version 2.19. Before this version,
3111
3155
strings were not allowed to spawn more than one line.</p>
3112
3156
 
3113
 
   <p class="footnote"><small>[<a name="fn-16" href="#fnd-16">16</a>]</small> Since version 2.19.</p>
 
3157
   <p class="footnote"><small>[<a name="fn-15" href="#fnd-15">15</a>]</small> Since version 2.19.</p>
3114
3158
 
3115
 
   <p class="footnote"><small>[<a name="fn-17" href="#fnd-17">17</a>]</small> This
 
3159
   <p class="footnote"><small>[<a name="fn-16" href="#fnd-16">16</a>]</small> This
3116
3160
holds since version 2.15: in previous versions the option specifications
3117
3161
had to be given in a fixed order.</p>
3118
3162
 
3119
 
   <p class="footnote"><small>[<a name="fn-18" href="#fnd-18">18</a>]</small> Before version 2.22 neither <code>--help</code> was added
 
3163
   <p class="footnote"><small>[<a name="fn-17" href="#fnd-17">17</a>]</small> Before version 2.22 neither <code>--help</code> was added
3120
3164
and you had to handle the help option manually</p>
3121
3165
 
3122
 
   <p class="footnote"><small>[<a name="fn-19" href="#fnd-19">19</a>]</small> Since version 2.16.</p>
 
3166
   <p class="footnote"><small>[<a name="fn-18" href="#fnd-18">18</a>]</small> Since version 2.16.</p>
3123
3167
 
3124
 
   <p class="footnote"><small>[<a name="fn-20" href="#fnd-20">20</a>]</small> Since version
 
3168
   <p class="footnote"><small>[<a name="fn-19" href="#fnd-19">19</a>]</small> Since version
3125
3169
2.22.</p>
3126
3170
 
3127
 
   <p class="footnote"><small>[<a name="fn-21" href="#fnd-21">21</a>]</small> Since version 2.18.</p>
3128
 
 
3129
 
   <p class="footnote"><small>[<a name="fn-22" href="#fnd-22">22</a>]</small> as it was up to version 2.22.2 of gengetopt.</p>
3130
 
 
3131
 
   <p class="footnote"><small>[<a name="fn-23" href="#fnd-23">23</a>]</small> This is taken from the
 
3171
   <p class="footnote"><small>[<a name="fn-20" href="#fnd-20">20</a>]</small> Since version 2.18.</p>
 
3172
 
 
3173
   <p class="footnote"><small>[<a name="fn-21" href="#fnd-21">21</a>]</small> as it was up to version 2.22.2 of gengetopt.</p>
 
3174
 
 
3175
   <p class="footnote"><small>[<a name="fn-22" href="#fnd-22">22</a>]</small> This is taken from the
3132
3176
comments in <samp><span class="file">getopt.in.h</span></samp> of gnulib.</p>
3133
3177
 
3134
 
   <p class="footnote"><small>[<a name="fn-24" href="#fnd-24">24</a>]</small> Since
 
3178
   <p class="footnote"><small>[<a name="fn-23" href="#fnd-23">23</a>]</small> Since
3135
3179
version 2.22 this field is of type <code>unsigned int</code> instead of
3136
3180
<code>int</code> for uniformity with multiple options.</p>
3137
3181
 
3138
 
   <p class="footnote"><small>[<a name="fn-25" href="#fnd-25">25</a>]</small> The <code>&lt;option&gt;_orig</code> was introduced in the release
 
3182
   <p class="footnote"><small>[<a name="fn-24" href="#fnd-24">24</a>]</small> The <code>&lt;option&gt;_orig</code> was introduced in the release
3139
3183
2.14.</p>
3140
3184
 
3141
 
   <p class="footnote"><small>[<a name="fn-26" href="#fnd-26">26</a>]</small> These strings and the
 
3185
   <p class="footnote"><small>[<a name="fn-25" href="#fnd-25">25</a>]</small> These strings and the
3142
3186
<code>&lt;option&gt;_help</code> were introduced in the release 2.17.</p>
3143
3187
 
3144
 
   <p class="footnote"><small>[<a name="fn-27" href="#fnd-27">27</a>]</small> This function was introduced in
 
3188
   <p class="footnote"><small>[<a name="fn-26" href="#fnd-26">26</a>]</small> This function was introduced in
3145
3189
the release 2.14.</p>
3146
3190
 
3147
 
   <p class="footnote"><small>[<a name="fn-28" href="#fnd-28">28</a>]</small> Introduced in version
 
3191
   <p class="footnote"><small>[<a name="fn-27" href="#fnd-27">27</a>]</small> Introduced in version
3148
3192
2.22, thanks to Papp Gyozo.</p>
3149
3193
 
3150
 
   <p class="footnote"><small>[<a name="fn-29" href="#fnd-29">29</a>]</small> Since version 2.17.</p>
3151
 
 
3152
 
   <p class="footnote"><small>[<a name="fn-30" href="#fnd-30">30</a>]</small> Since version 2.22.3.</p>
3153
 
 
3154
 
   <p class="footnote"><small>[<a name="fn-31" href="#fnd-31">31</a>]</small> Since version 2.22.</p>
3155
 
 
3156
 
   <p class="footnote"><small>[<a name="fn-32" href="#fnd-32">32</a>]</small> Since version 2.21.</p>
3157
 
 
3158
 
   <p class="footnote"><small>[<a name="fn-33" href="#fnd-33">33</a>]</small> Introduced in version 2.22</p>
3159
 
 
3160
 
   <p class="footnote"><small>[<a name="fn-34" href="#fnd-34">34</a>]</small> The <code>&lt;cmd_parser_name&gt;_params_init</code> was
 
3194
   <p class="footnote"><small>[<a name="fn-28" href="#fnd-28">28</a>]</small> Since version 2.17.</p>
 
3195
 
 
3196
   <p class="footnote"><small>[<a name="fn-29" href="#fnd-29">29</a>]</small> Since version 2.22.3.</p>
 
3197
 
 
3198
   <p class="footnote"><small>[<a name="fn-30" href="#fnd-30">30</a>]</small> Since version 2.22.</p>
 
3199
 
 
3200
   <p class="footnote"><small>[<a name="fn-31" href="#fnd-31">31</a>]</small> Since version 2.21.</p>
 
3201
 
 
3202
   <p class="footnote"><small>[<a name="fn-32" href="#fnd-32">32</a>]</small> Introduced in version 2.22</p>
 
3203
 
 
3204
   <p class="footnote"><small>[<a name="fn-33" href="#fnd-33">33</a>]</small> The <code>&lt;cmd_parser_name&gt;_params_init</code> was
3161
3205
introduced in version 2.21, but it used to initialize all its fields to
3162
3206
0, which does not make much sense, since it's more helpful to have the
3163
3207
fields initialized to their default values; in order not to silently
3170
3214
something has changed.  I'm sorry for the (hopefully little) problems
3171
3215
this change might imply.</p>
3172
3216
 
3173
 
   <p class="footnote"><small>[<a name="fn-35" href="#fnd-35">35</a>]</small> The
 
3217
   <p class="footnote"><small>[<a name="fn-34" href="#fnd-34">34</a>]</small> The
3174
3218
previous function <code>&lt;cmd_parser_name&gt;_configfile</code> &mdash; notice the
3175
3219
absence of the <code>_</code> &mdash; is deprecated and should be no longer used,
3176
3220
since it might be removed in the future releases.</p>
3177
3221
 
3178
 
   <p class="footnote"><small>[<a name="fn-36" href="#fnd-36">36</a>]</small> The previous function
 
3222
   <p class="footnote"><small>[<a name="fn-35" href="#fnd-35">35</a>]</small> The previous function
3179
3223
<code>&lt;cmd_parser_name&gt;2</code> &mdash; notice the <code>2</code> &mdash; is deprecated and
3180
3224
should be no longer used, since it might be removed in the future
3181
3225
releases.</p>
3182
3226
 
3183
 
   <p class="footnote"><small>[<a name="fn-37" href="#fnd-37">37</a>]</small> The previous function
 
3227
   <p class="footnote"><small>[<a name="fn-36" href="#fnd-36">36</a>]</small> The previous function
3184
3228
<code>&lt;cmd_parser_name&gt;_string2</code> &mdash; notice the <code>2</code> &mdash; is
3185
3229
deprecated and should be no longer used, since it might be removed in
3186
3230
the future releases.</p>
3187
3231
 
3188
 
   <p class="footnote"><small>[<a name="fn-38" href="#fnd-38">38</a>]</small> <a href="http://www.gnu.org/software/gnulib">http://www.gnu.org/software/gnulib</a></p>
 
3232
   <p class="footnote"><small>[<a name="fn-37" href="#fnd-37">37</a>]</small> <a href="http://www.gnu.org/software/gnulib">http://www.gnu.org/software/gnulib</a></p>
3189
3233
 
3190
 
   <p class="footnote"><small>[<a name="fn-39" href="#fnd-39">39</a>]</small> <code>optind</code> is the global variable in getopt
 
3234
   <p class="footnote"><small>[<a name="fn-38" href="#fnd-38">38</a>]</small> <code>optind</code> is the global variable in getopt
3191
3235
implementation that is the index in ARGV of the next element to be
3192
3236
scanned.  This is used for communication to and from the caller and
3193
3237
for communication between successive calls to <code>getopt_long</code>.</p>