Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Add printing of the style to zstyle+ through option -p
- X-seq: zsh-workers 44836
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: PATCH: Add printing of the style to zstyle+ through option -p
- Date: Tue, 15 Oct 2019 20:57:18 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fN01TnhLqrevXfINSNYgKzFAUy09jImp9N4c7bHOExg=; b=J4pLZuNRXc2s7CyeZaAl+NfvpL90YlnhnMzUlA79n5grDImWh96s0tBgJVCrk/pHMK 8KFfb8CLP/PakW5st/B+x5JOUmErjSlUD+e2cUGfMwWJdHRb9h8eZ4dPkGVKAJk3VhBN pPEa++kz8AzAOm02UsYcDZ3t2n7OPGzrPUIWKVy8K/b22+pi3jdTg7k60f1Bssh1IgYT ElT4M/jW/xO8WlS3YS+YBOAQ8cY7O3I2yILj8zMhI526XjRR22FaF4Bs/SFg9mRVkDqs PpXknrO7wRxEAbmhA2IqZ3jIuI2H2EiX2xyN+qCpxSclqrBk1NWqIo9WCE+vvOXGIrVI GCbw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
From 5f770ab08febe83adc5afbef44103139f98666a8 Mon Sep 17 00:00:00 2001
From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author