summaryrefslogtreecommitdiff
path: root/Doc/help/getopts
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
commitb09f4483416c54c1782824633dfabaf2ec0265b6 (patch)
tree304bc82642862525ae680c7fbaa249663b10ad57 /Doc/help/getopts
parent12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff)
parent6e55c920503071e917619b8cb1a188cd35d772db (diff)
downloadzsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz
zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip
New upstream version 5.8.1.2-test
Diffstat (limited to 'Doc/help/getopts')
-rw-r--r--Doc/help/getopts15
1 files changed, 8 insertions, 7 deletions
diff --git a/Doc/help/getopts b/Doc/help/getopts
index ef73c55c1..bb89d2f2a 100644
--- a/Doc/help/getopts
+++ b/Doc/help/getopts
@@ -16,15 +16,16 @@ getopts optstring name [ arg ... ]
The first option to be examined may be changed by explicitly as-
signing to OPTIND. OPTIND has an initial value of 1, and is
normally set to 1 upon entry to a shell function and restored
- upon exit (this is disabled by the POSIX_BUILTINS option). OP-
- TARG is not reset and retains its value from the most recent
- call to getopts. If either of OPTIND or OPTARG is explicitly
+ upon exit. (The POSIX_BUILTINS option disables this, and also
+ changes the way the value is calculated to match other shells.)
+ OPTARG is not reset and retains its value from the most recent
+ call to getopts. If either of OPTIND or OPTARG is explicitly
unset, it remains unset, and the index or option argument is not
stored. The option itself is still stored in name in this case.
A leading `:' in optstring causes getopts to store the letter of
- any invalid option in OPTARG, and to set name to `?' for an un-
- known option and to `:' when a required argument is missing.
- Otherwise, getopts sets name to `?' and prints an error message
- when an option is invalid. The exit status is nonzero when
+ any invalid option in OPTARG, and to set name to `?' for an un-
+ known option and to `:' when a required argument is missing.
+ Otherwise, getopts sets name to `?' and prints an error message
+ when an option is invalid. The exit status is nonzero when
there are no more options.