diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-09-01 13:57:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-01 13:57:29 -0700 |
commit | f7f8f21e826283e7a8109e0ae1743ffd5ea5815d (patch) | |
tree | f603eabf3cb7d98d1bf8fef984cda61360e89322 | |
parent | 594d2d454755bedd85c5bcb9fb5dc59990592087 (diff) | |
download | git-htmldocs-f7f8f21e826283e7a8109e0ae1743ffd5ea5815d.tar.gz |
Autogenerated HTML docs for v2.37.3-485-gbe1a0
-rw-r--r-- | RelNotes/2.38.0.txt | 13 | ||||
-rw-r--r-- | git-clone.html | 14 | ||||
-rw-r--r-- | git-clone.txt | 7 | ||||
-rw-r--r-- | gitremote-helpers.html | 21 | ||||
-rw-r--r-- | gitremote-helpers.txt | 9 | ||||
-rw-r--r-- | howto/coordinate-embargoed-releases.html | 2 | ||||
-rw-r--r-- | howto/keep-canonical-history-correct.html | 2 | ||||
-rw-r--r-- | howto/maintain-git.html | 2 | ||||
-rw-r--r-- | howto/new-command.html | 2 | ||||
-rw-r--r-- | howto/rebase-from-internal-branch.html | 2 | ||||
-rw-r--r-- | howto/rebuild-from-update-hook.html | 2 | ||||
-rw-r--r-- | howto/recover-corrupted-blob-object.html | 2 | ||||
-rw-r--r-- | howto/recover-corrupted-object-harder.html | 2 | ||||
-rw-r--r-- | howto/revert-a-faulty-merge.html | 2 | ||||
-rw-r--r-- | howto/revert-branch-rebase.html | 2 | ||||
-rw-r--r-- | howto/separating-topic-branches.html | 2 | ||||
-rw-r--r-- | howto/setup-git-server-over-http.html | 2 | ||||
-rw-r--r-- | howto/update-hook-example.html | 2 | ||||
-rw-r--r-- | howto/use-git-daemon.html | 2 | ||||
-rw-r--r-- | howto/using-merge-subtree.html | 2 | ||||
-rw-r--r-- | howto/using-signed-tag-in-pull-request.html | 2 | ||||
-rw-r--r-- | technical/api-parse-options.html | 81 | ||||
-rw-r--r-- | technical/api-parse-options.txt | 49 |
23 files changed, 198 insertions, 28 deletions
diff --git a/RelNotes/2.38.0.txt b/RelNotes/2.38.0.txt index 91a822e62..71e1731dd 100644 --- a/RelNotes/2.38.0.txt +++ b/RelNotes/2.38.0.txt @@ -72,6 +72,9 @@ UI, Workflows & Features * The bash prompt (in contrib/) learned to optionally indicate when the index is unmerged. + * "git clone" command learned the "--bundle-uri" option to coordinate + with hosting sites the use of pre-prepared bundle files. + Performance, Internal Implementation, Development Support etc. @@ -139,6 +142,9 @@ Performance, Internal Implementation, Development Support etc. * Test portability improvements. (merge 4d1d843be7 mt/rot13-in-c later to maint). + * The "subcommand" mode is introduced to parse-options API and update + the command line parser of Git commands with subcommands. + Fixes since v2.37 ----------------- @@ -296,5 +302,10 @@ Fixes since v2.37 to 22.04. (merge ef46584831 ds/github-actions-use-newer-ubuntu later to maint). + * The auto-stashed local changes created by "git merge --autostash" + was mixed into a conflicted state left in the working tree, which + has been corrected. + (merge d3a9295ada en/merge-unstash-only-on-clean-merge later to maint). + * Other code cleanup, docfix, build fix, etc. - (merge 77b9e85c0f vd/fix-perf-tests later to maint).
\ No newline at end of file + (merge 77b9e85c0f vd/fix-perf-tests later to maint). diff --git a/git-clone.html b/git-clone.html index f5dd7a277..36ef0a7bd 100644 --- a/git-clone.html +++ b/git-clone.html @@ -1242,6 +1242,18 @@ or <code>--mirror</code> is given)</p></div> is only allowed if the directory is empty.
</p>
</dd>
+<dt class="hdlist1">
+--bundle-uri=<uri>
+</dt>
+<dd>
+<p>
+ Before fetching from the remote, fetch a bundle from the given
+ <code><uri></code> and unbundle the data into the local repository. The refs
+ in the bundle will be stored under the hidden <code>refs/bundle/*</code>
+ namespace. This option is incompatible with <code>--depth</code>,
+ <code>--shallow-since</code>, and <code>--shallow-exclude</code>.
+</p>
+</dd>
</dl></div>
</div>
</div>
@@ -1440,7 +1452,7 @@ Create a bare repository to publish your changes to the public: <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:19:34 PST
+ 2022-09-01 13:55:22 PDT
</div>
</div>
</body>
diff --git a/git-clone.txt b/git-clone.txt index 632bd1348..d032d971d 100644 --- a/git-clone.txt +++ b/git-clone.txt @@ -323,6 +323,13 @@ or `--mirror` is given) for `host.xz:foo/.git`). Cloning into an existing directory is only allowed if the directory is empty. +--bundle-uri=<uri>:: + Before fetching from the remote, fetch a bundle from the given + `<uri>` and unbundle the data into the local repository. The refs + in the bundle will be stored under the hidden `refs/bundle/*` + namespace. This option is incompatible with `--depth`, + `--shallow-since`, and `--shallow-exclude`. + :git-clone: 1 include::urls.txt[] diff --git a/gitremote-helpers.html b/gitremote-helpers.html index e5d8bd0a5..57b295833 100644 --- a/gitremote-helpers.html +++ b/gitremote-helpers.html @@ -950,6 +950,14 @@ Other frontends may have some other order of preference.</p></div> pack is self contained and is connected.
</p>
</dd>
+<dt class="hdlist1">
+<em>get</em>
+</dt>
+<dd>
+<p>
+ Can use the <em>get</em> command to download a file from a given URI.
+</p>
+</dd>
</dl></div>
<div class="paragraph"><p>If a helper advertises <em>connect</em>, Git will use it if possible and
fall back to another capability if the helper requests so when
@@ -1266,6 +1274,17 @@ operations.</p></div> </p>
<div class="paragraph"><p>Supported if the helper has the "stateless-connect" capability.</p></div>
</dd>
+<dt class="hdlist1">
+<em>get</em> <uri> <path>
+</dt>
+<dd>
+<p>
+ Downloads the file from the given <code><uri></code> to the given <code><path></code>. If
+ <code><path>.temp</code> exists, then Git assumes that the <code>.temp</code> file is a
+ partial download from a previous attempt and will resume the
+ download from that position.
+</p>
+</dd>
</dl></div>
<div class="paragraph"><p>If a fatal error occurs, the program writes the error message to
stderr and exits. The caller should expect that a suitable error
@@ -1518,7 +1537,7 @@ the remote side using that algorithm.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2020-07-09 15:39:10 PDT
+ 2022-09-01 13:55:22 PDT
</div>
</div>
</body>
diff --git a/gitremote-helpers.txt b/gitremote-helpers.txt index 6f1e269ae..ed8da428c 100644 --- a/gitremote-helpers.txt +++ b/gitremote-helpers.txt @@ -168,6 +168,9 @@ Supported commands: 'list', 'import'. Can guarantee that when a clone is requested, the received pack is self contained and is connected. +'get':: + Can use the 'get' command to download a file from a given URI. + If a helper advertises 'connect', Git will use it if possible and fall back to another capability if the helper requests so when connecting (see the 'connect' command under COMMANDS). @@ -418,6 +421,12 @@ Supported if the helper has the "connect" capability. + Supported if the helper has the "stateless-connect" capability. +'get' <uri> <path>:: + Downloads the file from the given `<uri>` to the given `<path>`. If + `<path>.temp` exists, then Git assumes that the `.temp` file is a + partial download from a previous attempt and will resume the + download from that position. + If a fatal error occurs, the program writes the error message to stderr and exits. The caller should expect that a suitable error message has been printed if the child closes the connection without diff --git a/howto/coordinate-embargoed-releases.html b/howto/coordinate-embargoed-releases.html index b4337f4b7..8dd3a0455 100644 --- a/howto/coordinate-embargoed-releases.html +++ b/howto/coordinate-embargoed-releases.html @@ -873,7 +873,7 @@ Thanks, <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:08 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/keep-canonical-history-correct.html b/howto/keep-canonical-history-correct.html index 8600c1bdf..4847c4f63 100644 --- a/howto/keep-canonical-history-correct.html +++ b/howto/keep-canonical-history-correct.html @@ -938,7 +938,7 @@ tip of your <em>master</em> again and redo the two merges:</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:08 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/maintain-git.html b/howto/maintain-git.html index b6df4659a..bd6c65d22 100644 --- a/howto/maintain-git.html +++ b/howto/maintain-git.html @@ -1469,7 +1469,7 @@ $ git update-ref -d $mf/ai/topic</code></pre> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:08 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/new-command.html b/howto/new-command.html index 37b77f7f5..d4c8c3cda 100644 --- a/howto/new-command.html +++ b/howto/new-command.html @@ -863,7 +863,7 @@ letter [PATCH 0/n]. <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:05 PDT
+ 2022-09-01 13:55:55 PDT
</div>
</div>
</body>
diff --git a/howto/rebase-from-internal-branch.html b/howto/rebase-from-internal-branch.html index 6ea17efca..243a7c598 100644 --- a/howto/rebase-from-internal-branch.html +++ b/howto/rebase-from-internal-branch.html @@ -895,7 +895,7 @@ the #1' commit.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:08 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/rebuild-from-update-hook.html b/howto/rebuild-from-update-hook.html index e8b516939..7f7d72b74 100644 --- a/howto/rebuild-from-update-hook.html +++ b/howto/rebuild-from-update-hook.html @@ -847,7 +847,7 @@ This is still crude and does not protect against simultaneous <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:08 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-blob-object.html b/howto/recover-corrupted-blob-object.html index ed56a5d84..523b02981 100644 --- a/howto/recover-corrupted-blob-object.html +++ b/howto/recover-corrupted-blob-object.html @@ -880,7 +880,7 @@ thing.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:07 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-object-harder.html b/howto/recover-corrupted-object-harder.html index 002f766f0..a287aec05 100644 --- a/howto/recover-corrupted-object-harder.html +++ b/howto/recover-corrupted-object-harder.html @@ -1189,7 +1189,7 @@ int main(int argc, char **argv) <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:07 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/revert-a-faulty-merge.html b/howto/revert-a-faulty-merge.html index 2f54d7d21..a66fa5f26 100644 --- a/howto/revert-a-faulty-merge.html +++ b/howto/revert-a-faulty-merge.html @@ -1025,7 +1025,7 @@ P---o---o---M---x---x---W---x---M2 <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:07 PDT
+ 2022-09-01 13:55:57 PDT
</div>
</div>
</body>
diff --git a/howto/revert-branch-rebase.html b/howto/revert-branch-rebase.html index 359bb9d99..bf501a71f 100644 --- a/howto/revert-branch-rebase.html +++ b/howto/revert-branch-rebase.html @@ -907,7 +907,7 @@ Committed merge 7fb9b7262a1d1e0a47bbfdcbbcf50ce0635d3f8f <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:55 PDT
</div>
</div>
</body>
diff --git a/howto/separating-topic-branches.html b/howto/separating-topic-branches.html index c4250ae9a..9b294f32a 100644 --- a/howto/separating-topic-branches.html +++ b/howto/separating-topic-branches.html @@ -841,7 +841,7 @@ o---o"master"</code></pre> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:07 PDT
+ 2022-09-01 13:55:56 PDT
</div>
</div>
</body>
diff --git a/howto/setup-git-server-over-http.html b/howto/setup-git-server-over-http.html index 92fed788d..25106e915 100644 --- a/howto/setup-git-server-over-http.html +++ b/howto/setup-git-server-over-http.html @@ -1071,7 +1071,7 @@ help diagnosing the problem, but removes security checks.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:56 PDT
</div>
</div>
</body>
diff --git a/howto/update-hook-example.html b/howto/update-hook-example.html index 6e8259a12..60cf0a461 100644 --- a/howto/update-hook-example.html +++ b/howto/update-hook-example.html @@ -930,7 +930,7 @@ that JC can make non-fast-forward pushes on it.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:56 PDT
</div>
</div>
</body>
diff --git a/howto/use-git-daemon.html b/howto/use-git-daemon.html index c40209fe2..76110f745 100644 --- a/howto/use-git-daemon.html +++ b/howto/use-git-daemon.html @@ -791,7 +791,7 @@ a good practice to put the paths after a "--" separator.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:56 PDT
</div>
</div>
</body>
diff --git a/howto/using-merge-subtree.html b/howto/using-merge-subtree.html index d24558885..e0fd5ada8 100644 --- a/howto/using-merge-subtree.html +++ b/howto/using-merge-subtree.html @@ -848,7 +848,7 @@ Please note that if the other project merges from you, then it will <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:55 PDT
</div>
</div>
</body>
diff --git a/howto/using-signed-tag-in-pull-request.html b/howto/using-signed-tag-in-pull-request.html index e0f525b87..b66e7a854 100644 --- a/howto/using-signed-tag-in-pull-request.html +++ b/howto/using-signed-tag-in-pull-request.html @@ -952,7 +952,7 @@ as part of the merge commit.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-08-30 10:57:06 PDT
+ 2022-09-01 13:55:56 PDT
</div>
</div>
</body>
diff --git a/technical/api-parse-options.html b/technical/api-parse-options.html index 3298585db..8820a402d 100644 --- a/technical/api-parse-options.html +++ b/technical/api-parse-options.html @@ -747,7 +747,8 @@ and to provide a usage help with consistent look.</p></div> <h2 id="_basics">Basics</h2>
<div class="sectionbody">
<div class="paragraph"><p>The argument vector <code>argv[]</code> may usually contain mandatory or optional
-<em>non-option arguments</em>, e.g. a filename or a branch, and <em>options</em>.
+<em>non-option arguments</em>, e.g. a filename or a branch, <em>options</em>, and
+<em>subcommands</em>.
Options are optional arguments that start with a dash and
that allow to change the behavior of a command.</p></div>
<div class="ulist"><ul>
@@ -813,6 +814,53 @@ Options and non-option arguments can clearly be separated using the <code>--</co </p>
</li>
</ul></div>
+<div class="paragraph"><p>Subcommands are special in a couple of ways:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Subcommands only have long form, and they have no double dash prefix, no
+ negated form, and no description, and they don’t take any arguments, and
+ can’t be abbreviated.
+</p>
+</li>
+<li>
+<p>
+There must be exactly one subcommand among the arguments, or zero if the
+ command has a default operation mode.
+</p>
+</li>
+<li>
+<p>
+All arguments following the subcommand are considered to be arguments of
+ the subcommand, and, conversely, arguments meant for the subcommand may
+ not preceed the subcommand.
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Therefore, if the options array contains at least one subcommand and
+<code>parse_options()</code> encounters the first dashless argument, it will either:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+stop and return, if that dashless argument is a known subcommand, setting
+ <code>value</code> to the function pointer associated with that subcommand, storing
+ the name of the subcommand in argv[0], and leaving the rest of the
+ arguments unprocessed, or
+</p>
+</li>
+<li>
+<p>
+stop and return, if it was invoked with the <code>PARSE_OPT_SUBCOMMAND_OPTIONAL</code>
+ flag and that dashless argument doesn’t match any subcommands, leaving
+ <code>value</code> unchanged and the rest of the arguments unprocessed, or
+</p>
+</li>
+<li>
+<p>
+show error and usage, and abort.
+</p>
+</li>
+</ul></div>
</div>
</div>
<div class="sect1">
@@ -885,11 +933,11 @@ before the full parser, which in turn shows the full help message.</p></div> </p>
</dd>
<dt class="hdlist1">
-<code>PARSE_OPT_KEEP_UNKNOWN</code>
+<code>PARSE_OPT_KEEP_UNKNOWN_OPT</code>
</dt>
<dd>
<p>
- Keep unknown arguments instead of erroring out. This doesn’t
+ Keep unknown options instead of erroring out. This doesn’t
work for all combinations of arguments as users might expect
it to do. E.g. if the first argument in <code>--unknown --known</code>
takes a value (which we can’t know), the second one is
@@ -899,6 +947,8 @@ before the full parser, which in turn shows the full help message.</p></div> non-option, not as a value belonging to the unknown option,
the parser early. That’s why parse_options() errors out if
both options are set.
+ Note that non-option arguments are always kept, even without
+ this flag.
</p>
</dd>
<dt class="hdlist1">
@@ -912,9 +962,20 @@ before the full parser, which in turn shows the full help message.</p></div> options, or to just leave them unknown.
</p>
</dd>
+<dt class="hdlist1">
+<code>PARSE_OPT_SUBCOMMAND_OPTIONAL</code>
+</dt>
+<dd>
+<p>
+ Don’t error out when no subcommand is specified.
+</p>
+</dd>
</dl></div>
</li>
</ol></div>
+<div class="paragraph"><p>Note that <code>PARSE_OPT_STOP_AT_NON_OPTION</code> is incompatible with subcommands;
+while <code>PARSE_OPT_KEEP_DASHDASH</code> and <code>PARSE_OPT_KEEP_UNKNOWN_OPT</code> can only be
+used with subcommands when combined with <code>PARSE_OPT_SUBCOMMAND_OPTIONAL</code>.</p></div>
</div>
</div>
<div class="sect1">
@@ -1169,9 +1230,19 @@ There are some macros to easily define options:</p></div> <p>
Define an "operation mode" option, only one of which in the same
group of "operating mode" options that share the same <code>int_var</code>
- can be given by the user. <code>enum_val</code> is set to <code>int_var</code> when the
+ can be given by the user. <code>int_var</code> is set to <code>enum_val</code> when the
option is used, but an error is reported if other "operating mode"
option has already set its value to the same <code>int_var</code>.
+ In new commands consider using subcommands instead.
+</p>
+</dd>
+<dt class="hdlist1">
+<code>OPT_SUBCOMMAND(long, &fn_ptr, subcommand_fn)</code>
+</dt>
+<dd>
+<p>
+ Define a subcommand. <code>subcommand_fn</code> is put into <code>fn_ptr</code> when
+ this subcommand is used.
</p>
</dd>
</dl></div>
@@ -1280,7 +1351,7 @@ for real-world examples.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2021-09-23 14:33:59 PDT
+ 2022-09-01 13:55:22 PDT
</div>
</div>
</body>
diff --git a/technical/api-parse-options.txt b/technical/api-parse-options.txt index acfd5dc1d..c2a5e4291 100644 --- a/technical/api-parse-options.txt +++ b/technical/api-parse-options.txt @@ -8,7 +8,8 @@ Basics ------ The argument vector `argv[]` may usually contain mandatory or optional -'non-option arguments', e.g. a filename or a branch, and 'options'. +'non-option arguments', e.g. a filename or a branch, 'options', and +'subcommands'. Options are optional arguments that start with a dash and that allow to change the behavior of a command. @@ -48,6 +49,33 @@ The parse-options API allows: option, e.g. `-a -b --option -- --this-is-a-file` indicates that `--this-is-a-file` must not be processed as an option. +Subcommands are special in a couple of ways: + +* Subcommands only have long form, and they have no double dash prefix, no + negated form, and no description, and they don't take any arguments, and + can't be abbreviated. + +* There must be exactly one subcommand among the arguments, or zero if the + command has a default operation mode. + +* All arguments following the subcommand are considered to be arguments of + the subcommand, and, conversely, arguments meant for the subcommand may + not preceed the subcommand. + +Therefore, if the options array contains at least one subcommand and +`parse_options()` encounters the first dashless argument, it will either: + +* stop and return, if that dashless argument is a known subcommand, setting + `value` to the function pointer associated with that subcommand, storing + the name of the subcommand in argv[0], and leaving the rest of the + arguments unprocessed, or + +* stop and return, if it was invoked with the `PARSE_OPT_SUBCOMMAND_OPTIONAL` + flag and that dashless argument doesn't match any subcommands, leaving + `value` unchanged and the rest of the arguments unprocessed, or + +* show error and usage, and abort. + Steps to parse options ---------------------- @@ -90,8 +118,8 @@ Flags are the bitwise-or of: Keep the first argument, which contains the program name. It's removed from argv[] by default. -`PARSE_OPT_KEEP_UNKNOWN`:: - Keep unknown arguments instead of erroring out. This doesn't +`PARSE_OPT_KEEP_UNKNOWN_OPT`:: + Keep unknown options instead of erroring out. This doesn't work for all combinations of arguments as users might expect it to do. E.g. if the first argument in `--unknown --known` takes a value (which we can't know), the second one is @@ -101,6 +129,8 @@ Flags are the bitwise-or of: non-option, not as a value belonging to the unknown option, the parser early. That's why parse_options() errors out if both options are set. + Note that non-option arguments are always kept, even without + this flag. `PARSE_OPT_NO_INTERNAL_HELP`:: By default, parse_options() handles `-h`, `--help` and @@ -108,6 +138,13 @@ Flags are the bitwise-or of: turns it off and allows one to add custom handlers for these options, or to just leave them unknown. +`PARSE_OPT_SUBCOMMAND_OPTIONAL`:: + Don't error out when no subcommand is specified. + +Note that `PARSE_OPT_STOP_AT_NON_OPTION` is incompatible with subcommands; +while `PARSE_OPT_KEEP_DASHDASH` and `PARSE_OPT_KEEP_UNKNOWN_OPT` can only be +used with subcommands when combined with `PARSE_OPT_SUBCOMMAND_OPTIONAL`. + Data Structure -------------- @@ -236,10 +273,14 @@ There are some macros to easily define options: `OPT_CMDMODE(short, long, &int_var, description, enum_val)`:: Define an "operation mode" option, only one of which in the same group of "operating mode" options that share the same `int_var` - can be given by the user. `enum_val` is set to `int_var` when the + can be given by the user. `int_var` is set to `enum_val` when the option is used, but an error is reported if other "operating mode" option has already set its value to the same `int_var`. + In new commands consider using subcommands instead. +`OPT_SUBCOMMAND(long, &fn_ptr, subcommand_fn)`:: + Define a subcommand. `subcommand_fn` is put into `fn_ptr` when + this subcommand is used. The last element of the array must be `OPT_END()`. |