zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Default true boolean zstyle
Date: Fri, 14 Oct 2016 20:12:00 +0000	[thread overview]
Message-ID: <20161014201200.GB4531@fujitsu.shahaf.local2> (raw)
In-Reply-To: <CAH+w=7Za9OrnssbzWN88F2RHoFdVhNKy0_k93P=ZQXQcjY2RZg__38913.3170749576$1476473552$gmane$org@mail.gmail.com>

Bart Schaefer wrote on Fri, Oct 14, 2016 at 10:53:01 -0700:
> On Thu, Oct 13, 2016 at 11:27 PM, Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> > Apparently, zstyle -b returns false when the boolean being read is
> > false.
> >
> > Is there a way to have default-true boolean with zstyle?
> 
> You have to use
>     zstyle -T :test-context test-style && test_var=yes || zstyle -b
> :test-context test-style test_var

It's still surprising (and undocumented) that -b returns false when the
value of the style is false.  I expected it to return 0 for the same
reason that _call_function returns 0 when the called function returns
non-zero: $? == 0 means retrieving the value succeeded; check $test_var
to see what the value is.

But it's been this way for 15+ years...


      parent reply	other threads:[~2016-10-14 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14  6:27 Sebastian Gniazdowski
2016-10-14 17:53 ` Bart Schaefer
     [not found] ` <CAH+w=7Za9OrnssbzWN88F2RHoFdVhNKy0_k93P=ZQXQcjY2RZg__38913.3170749576$1476473552$gmane$org@mail.gmail.com>
2016-10-14 20:12   ` Daniel Shahaf [this message]

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=20161014201200.GB4531@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@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).