diff options
| author | dana <dana@dana.is> | 2026-04-19 12:35:02 -0500 |
|---|---|---|
| committer | dana <dana@dana.is> | 2026-04-19 12:36:10 -0500 |
| commit | 90fa3d2816ee3c770966dd42f548d770d266d2bd (patch) | |
| tree | 043524d84eaa407ebd31bf51dfa4819b6c978bc3 /Doc | |
| parent | 54181, 54331: remove support for restricted shell (diff) | |
| download | zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar.gz zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar.bz2 zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar.lz zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar.xz zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.tar.zst zsh-90fa3d2816ee3c770966dd42f548d770d266d2bd.zip | |
54361 (tweaked): zparseopts: print friendlier usage errors, add -n option
tweaked to adjust order of options in documentation
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/Zsh/mod_zutil.yo | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/Zsh/mod_zutil.yo b/Doc/Zsh/mod_zutil.yo index 06b953f69..47daec3cb 100644 --- a/Doc/Zsh/mod_zutil.yo +++ b/Doc/Zsh/mod_zutil.yo @@ -230,7 +230,7 @@ item(tt(zregexparse))( This implements some internals of the tt(_regex_arguments) function. ) findex(zparseopts) -item(tt(zparseopts) [ tt(-D) tt(-E) tt(-F) tt(-G) tt(-K) tt(-M) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] [ tt(-v) var(argv) ] [ tt(-) ] var(spec) ...)( +item(tt(zparseopts) [ tt(-D) tt(-E) tt(-F) tt(-G) tt(-K) tt(-M) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] [ tt(-n) var(name) ] [ tt(-v) var(argv) ] [ tt(-) ] var(spec) ...)( This builtin simplifies the parsing of options in positional parameters, i.e. the set of arguments given by tt($*). Each var(spec) describes one option and must be of the form `var(opt)[tt(=)var(array)]'. If an option @@ -391,6 +391,12 @@ is found, the values are stored as usual. This changes only the way the values are stored, not the way tt($*) is parsed, so results may be unpredictable if the `var(name)tt(+)' specifier is used inconsistently. ) +item(tt(-n) var(name))( +If this option is given, var(name) is used when printing usage errors +intended for the end user. Otherwise, the name of the calling function +or script is used. Error messages arising from misusage of tt(zparseopts) +itself are not affected by this option. +) item(tt(-v) var(argv))( With this option, the elements of the named array var(argv) are used as the positional parameters to parse, rather than those given by tt($*). The |
