From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] typeset -p doesn't report -U (unique) attribute
Date: Mon, 24 Sep 2018 22:05:50 +0100 [thread overview]
Message-ID: <20180924210550.carijwjibarjivu4@chaz.gmail.com> (raw)
From:
https://unix.stackexchange.com/questions/470956/how-to-print-all-the-attributes-of-a-zsh-parameter
$ typeset -U a=(x x)
$ typeset -p a
typeset -a a=( x )
Expected:
$ typeset -p a
typeset -aU a=( x )
diff --git a/Src/params.c b/Src/params.c
index a1c299f60..f7ecff32a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -5854,20 +5854,27 @@ printparamnode(HashNode hn, int printflags)
if ((pmptr->flags & PMTF_USE_BASE) && p->base) {
printf("%d ", p->base);
doneminus = 0;
}
if ((pmptr->flags & PMTF_USE_WIDTH) && p->width) {
printf("%d ", p->width);
doneminus = 0;
}
}
}
+ if (p->node.flags & PM_UNIQUE) {
+ if (!doneminus) {
+ putchar('-');
+ doneminus = 1;
+ }
+ putchar('U');
+ }
if (doneminus)
putchar(' ');
}
if ((printflags & PRINT_NAMEONLY) ||
((p->node.flags & PM_HIDEVAL) && !(printflags & PRINT_INCLUDEVALUE))) {
zputs(p->node.nam, stdout);
putchar('\n');
} else {
if (printflags & PRINT_KV_PAIR) {
next reply other threads:[~2018-09-24 21:06 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-24 21:05 Stephane Chazelas [this message]
2018-09-25 16:41 ` Daniel Shahaf
2018-10-07 13:35 ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Stephane Chazelas
2018-10-08 9:05 ` Peter Stephenson
[not found] ` <CACeGjnUhNqca7jLAR0KKSxobzDd+xXdAe4BeUeRpxu2CTp_zkA@mail.gmail.com>
2018-10-08 14:10 ` Peter Stephenson
2018-10-08 14:28 ` Daniel Shahaf
2018-10-08 15:24 ` Peter Stephenson
2018-10-08 15:49 ` Daniel Shahaf
2018-10-08 15:57 ` Bart Schaefer
2018-10-08 16:06 ` Daniel Shahaf
2018-10-08 16:52 ` Bart Schaefer
2018-10-08 16:58 ` Peter Stephenson
2018-10-08 16:02 ` Daniel Shahaf
2018-10-08 16:19 ` Peter Stephenson
2018-10-08 16:43 ` Peter Stephenson
2018-10-08 16:58 ` Daniel Shahaf
2018-10-08 17:14 ` Bart Schaefer
2018-10-08 19:39 ` Stephane Chazelas
2018-10-09 9:02 ` Peter Stephenson
[not found] ` <1539075745.1499.2.camel@samsung.com>
2018-10-09 9:44 ` Peter Stephenson
2018-10-09 16:52 ` Bart Schaefer
2018-10-09 23:40 ` Vin Shelton
2018-10-08 15:54 ` Bart Schaefer
2018-10-08 16:40 ` Bart Schaefer
2018-10-09 10:59 ` local read-only variables (Was:[PATCH] [long] typeset doesn't report tied parameters (and related issues)) Stephane Chazelas
2018-10-11 9:45 ` [PATCH] [long] typeset doesn't report tied parameters (and related issues) Oliver Kiddle
2018-10-11 12:46 ` Peter Stephenson
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=20180924210550.carijwjibarjivu4@chaz.gmail.com \
--to=stephane.chazelas@gmail.com \
--cc=zsh-workers@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).