Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Default true boolean zstyle



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