zsh-users
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <larryv@zsh.org>
To: zsh-users@zsh.org
Subject: Re: manual
Date: Wed, 21 Dec 2022 04:38:49 -0500	[thread overview]
Message-ID: <e65f0c98-0d12-46d2-9a98-db8719ac48e2@app.fastmail.com> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2022-12-21  9:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 22:41 manual Ray Andrews
2022-12-21  0:43 ` manual Lawrence Velázquez
2022-12-21  1:15   ` manual Ray Andrews
2022-12-21  1:44     ` manual Lawrence Velázquez
2022-12-21  4:15       ` manual Ray Andrews
2022-12-21  2:00 ` manual Daniel Shahaf
2022-12-21  4:12   ` manual Ray Andrews
2022-12-21  4:43   ` manual Bart Schaefer
2022-12-21 14:04     ` manual Ray Andrews
2022-12-22  6:31       ` manual Lawrence Velázquez
2022-12-22 14:20         ` manual Ray Andrews
2022-12-21  9:38   ` Lawrence Velázquez [this message]
2022-12-22  7:03 ` manual Lawrence Velázquez
2022-12-22 13:50   ` manual Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e65f0c98-0d12-46d2-9a98-db8719ac48e2@app.fastmail.com \
    --to=larryv@zsh.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).