mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
39236 (plus typo fix): docs: Tweak _arguments $opt_args documentation added in 39173.
This commit is contained in:
parent
198c7bc232
commit
73622ae288
3 changed files with 14 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-09-08 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 39236 (plus typo fix): Doc/Zsh/compsys.yo, README: docs: Tweak
|
||||
_arguments $opt_args documentation added in 39173.
|
||||
|
||||
2016-09-08 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 39222: Test/V01zmodload.ztst: test use of module loaded math
|
||||
|
|
|
@ -3949,9 +3949,7 @@ arguments. Options are stored in the associative array
|
|||
`tt(opt_args)' with option names as keys and their arguments as
|
||||
the values. For options that have more than one argument these are
|
||||
given as one string, separated by colons. All colons and backslashes
|
||||
in the original arguments are preceded with backslashes. (Note:
|
||||
Zsh 5.2 and older did not escape backslashes in the original string;
|
||||
see the tt(NEWS) file for details.)
|
||||
in the original arguments are preceded with backslashes.
|
||||
|
||||
The parameter `tt(context)' is set when returning to the calling function
|
||||
to perform an action of the form `tt(->)var(string)'. It is set to an
|
||||
|
|
11
README
11
README
|
@ -91,10 +91,15 @@ equivalent of "*(1)") as well as many other forms.
|
|||
and colons in the values of option arguments when populating the $opt_args
|
||||
associative array. Previously, colons were escaped with a backslash but
|
||||
backslashes were not themselves escaped with a backslash, which lead to
|
||||
ambiguity: if the -x option took two arguments (as in
|
||||
ambiguity: '-x foo\:bar' (one argument with a backslashed colon) and
|
||||
'-x foo\\ bar' (two arguments, and the first one ends in a backslash) would
|
||||
both set $opt_args[-x] to the same value. This example assumes the -x
|
||||
option's spec declared two arguments, as in:
|
||||
_arguments : -x:foo:${action}:bar:$action
|
||||
), it would be impossible to tell from $opt_args whether the command-line
|
||||
was '-x foo\:bar' or '-x foo\\ bar'.
|
||||
|
||||
For the more common case of non-repeatable options that take a single
|
||||
argument, completion functions now have to unescape not only colons but
|
||||
also backslashes when obtaining the option's argument from $opt_args.
|
||||
|
||||
Incompatibilities between 5.0.8 and 5.2
|
||||
---------------------------------------
|
||||
|
|
Loading…
Reference in a new issue