Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Default true boolean zstyle
- X-seq: zsh-users 22009
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Default true boolean zstyle
- Date: Fri, 14 Oct 2016 08:27:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=Ngo600G8vXnvlDjnr/jqgFDsFHbANKufk7P7xdMJN6s=; b=jbxynSRRj5s8bMOBxQJKMMVvXP1LKGFOEDrIv8J5S/fxCyxJwb3YOe+zY2x5/6ftrE M/tpkaYVOevclAXGs2BT09jIXdsc+xBHWG94tPrR3NaoQJd16lPf3NvDya73T3WyTyAn enIZqNViGuzANkIEHYT9a3i2PPAJ8ZHAYbv26FcSal5o3dg3QVjy+cN8nyq7k8gdAKHj OziOr8WV0GQ2+0R/57MXEnOdAM2Dn08v7b8yiQZWzhDoiF7Krwh3Z+Xu17BTeMesvEvR ugwS8kaE0g1z2nxVP9leagAqMD/K48sQSE09O8Mu6fM5plq1zYRkWGKSb5c4Jdx6KtkY DR7Q==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
following code explains:
% zstyle -b ":test-context" test_var test_var || test_var="yes"
% echo $test_var
yes
% zstyle ":test-context" test_var 0
% zstyle -b ":test-context" test_var test_var || test_var="yes"
% echo $test_var
yes
Apparently, zstyle -b returns false when the boolean being read is
false. So "|| test_var=yes" is triggered, and the value is
overwritten. Following way also doesn't do what's expected:
% test_var="yes"
% zstyle -b ":test-context" test_var test_var
% echo $test_var
no
Is there a way to have default-true boolean with zstyle?
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author