Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: manual
- X-seq: zsh-users 28604
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: manual
- Date: Wed, 21 Dec 2022 04:38:49 -0500
- Archived-at: <https://zsh.org/users/28604>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <20221221020026.GH8411@tarpaulin.shahaf.local2>
- List-id: <zsh-users.zsh.org>
- References: <71c9c7e9-3f95-143d-fbd6-6575d7f4c446@eastlink.ca> <20221221020026.GH8411@tarpaulin.shahaf.local2>
On Tue, Dec 20, 2022, at 9:00 PM, Daniel Shahaf wrote:
> Let's try and focus please and
> the two specific issues identified («set -A» and types; «set -A» and
> prefixes).
Here's an attempt. Instead of trying to address every possible
case, I chose to describe the behavior in terms of other assignment
constructs which (to my knowledge) operate equivalently.
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 56428a714..fca6db8e5 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1687,13 +1687,19 @@ the description of tt(setopt) below for more information on the format.
With tt(PLUS()o) they are printed in a form that can be used as input
to the shell.
-If the tt(-A) flag is specified, var(name) is set to an array containing
-the given var(arg)s; if no var(name) is specified, all arrays are printed
-together with their values.
-
-If tt(PLUS()A) is used and var(name) is an array, the
-given arguments will replace the initial elements of that array; if no
-var(name) is specified, all arrays are printed without their values.
+If tt(-A) var(name) is specified, the var(arg)s are assigned to
+var(name) as with `var(name)tt(=LPAR())var(arg) ...tt(RPAR())'. If
+tt(-A) is specified without var(name), all arrays are printed together
+with their values.
+
+If tt(PLUS()A) var(name) is specified, and var(name) is a normal array,
+the var(arg)s are assigned to var(name) as with
+`var(name)tt([1,)var(N)tt(]=LPAR())var(arg) ...tt(RPAR())' (or
+`var(name)tt([0,)var(N)tt(-1]=LPAR())var(arg) ...tt(RPAR())' with
+tt(KSH_ARRAYS) set), where var(N) is the number of var(arg)s provided.
+If var(name) is not a normal array, tt(PLUS()A) var(name) behaves like
+tt(-A) var(name). If tt(PLUS()A) is specified without var(name), all
+arrays are printed without their values.
The behaviour of arguments after tt(-A) var(name) or tt(PLUS()A) var(name)
depends on whether the option tt(KSH_ARRAYS) is set. If it is not set, all
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author