Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Default true boolean zstyle
- X-seq: zsh-users 22011
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Default true boolean zstyle
- Date: Fri, 14 Oct 2016 20:12:00 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=UNXeYLTuLaasvdXHbg5FsMPFZ6s=; b=PpvvGs HmM+K2eNuqyiTZvV2xyqfSqHgMdEcgmUh4XcnP8V62NQZ4VhF5J5BtghaYR63jQl klYFFY0KG/xo3/Z+6i1CfsyL/dWBkV8mHxGDwLLZxplcLh4Sae6yabIZ0WZnskH1 Ma9kewjpDV1DqCpJyiyDYsnQwD4GsJjnxJSXo=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=UNXeYLTuLaasvdXHbg5FsMPFZ6s=; b=lRsAG RtAR3t0NzRAbc+7nq6B320Tmn+1i0K8iDfPQtvwrr4ArOgfHnR5XBm0+L5RsqP92 TIlEB5rZXk91xNN+XvnIhKkjyvolVI6XcudASuhrjy101NirrJ1HY2Dtm3ngeDqK X2pMfnXJbfSuSfue7lHEF/nR7Ji669KUahcyHY=
- In-reply-to: <CAH+w=7Za9OrnssbzWN88F2RHoFdVhNKy0_k93P=ZQXQcjY2RZg__38913.3170749576$1476473552$gmane$org@mail.gmail.com>
- 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
- References: <CAKc7PVDZJH28+x-FPNB3tKxP7z1yY73KJAqjnX1tTQjgegdH4Q@mail.gmail.com> <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@xxxxxxxxx> 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...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author