summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-11-29 06:31:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-11-29 06:31:58 -0800
commitf7bd4d5f84f01af3167defd05df41738174d0bf1 (patch)
tree7406946e1e0c8a7e3dbf53a2d08ecf73feeabaf5
parent83a156bbf2e5cf598911ec8f34e094fb93d7ebae (diff)
downloadtxr-f7bd4d5f84f01af3167defd05df41738174d0bf1.tar.gz
txr-f7bd4d5f84f01af3167defd05df41738174d0bf1.tar.bz2
txr-f7bd4d5f84f01af3167defd05df41738174d0bf1.zip
doc: getopt: long and short options appear in index.
* txr.1: Document that in the parsed opts object returned by getopts, an option which has two names (long and short form) is indexed under both names if it has occurred in the command line, regardless of whether it has occurred under the short or long name.
-rw-r--r--txr.117
1 files changed, 17 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 7549eb9a..474aa81b 100644
--- a/txr.1
+++ b/txr.1
@@ -56913,6 +56913,23 @@ is possible. This replaces the value associated with option
The assignment is erroneous if no such option was parsed
from the command line, even if it is a valid option.
+If an option is defined with both a long form and a short form,
+and either form of that option occurs in the command line being
+processed, then the option appears under both names in the index.
+
+For instance if option
+.str --verbose
+has the short form
+.strn -v ,
+and either option occurs, then both the keys
+.str "v"
+and
+.str "verbose"
+will exist in the
+.code opts
+structure returned by
+.codn getopts .
+
.coNP Function @ getopts
.synb
.mets (getopts < option-desc-list << arg-list )