From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: PATCH: Add printing of the style to zstyle+ through option -p
Date: Tue, 15 Oct 2019 20:57:18 +0200 [thread overview]
Message-ID: <CAKc7PVCzAuby5-JP5iyKY6D8yBfRTU=AyhYdwt0vr-rwO4QVNw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
Hello,
I think that many of us often dreamed about omitting the output
parameter and the following print when checking out a value of style:
zstyle -s :the:style:path style the_parameter; print $the_parameter
I've stumbled upon the interesting function zstyle+ and I thought
about adding an option -p to it that would print the style:
zstyle+ -p :the:style:path style
The simple patch adds the option.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
[-- Attachment #2: 0001-Add-option-p-to-zstyle-printing-of-the-style-to-the-.patch.txt --]
[-- Type: text/plain, Size: 1166 bytes --]
From 5f770ab08febe83adc5afbef44103139f98666a8 Mon Sep 17 00:00:00 2001
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Tue, 15 Oct 2019 20:49:18 +0200
Subject: [PATCH] =?UTF-8?q?Add=20option=20-p=20to=20zstyle+=20=E2=80=93=20?=
=?UTF-8?q?printing=20of=20the=20style=20to=20the=20stdout?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Functions/Misc/zstyle+ | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Functions/Misc/zstyle+ b/Functions/Misc/zstyle+
index 81b4f0552..66a4eb34b 100644
--- a/Functions/Misc/zstyle+
+++ b/Functions/Misc/zstyle+
@@ -17,8 +17,14 @@
# the completion functions are autoloaded without alias expansion (the
# -U option to the autoload builtin). The completion system normally
# loads its functions with without alias expansion.
+#
+# Tue Oct 15 20:38:16 CEST 2019
+# The option -p prints the value of the style. The normal usage is to
+# use it in place of the option -s and to omit the output parameter.
case "$1" in
+-p) shift; local value; zstyle -s "$@" value; print -r -- "$value";;
+
-*) zstyle "$@";;
*) setopt localoptions noksharrays
--
2.21.0
next reply other threads:[~2019-10-15 18:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 18:57 Sebastian Gniazdowski [this message]
2019-10-16 1:44 ` Daniel Shahaf
2019-10-16 21:08 ` Sebastian Gniazdowski
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='CAKc7PVCzAuby5-JP5iyKY6D8yBfRTU=AyhYdwt0vr-rwO4QVNw@mail.gmail.com' \
--to=sgniazdowski@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).