From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9795 invoked by alias); 14 Oct 2016 20:13:47 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22011 Received: (qmail 9947 invoked from network); 14 Oct 2016 20:13:47 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(0.0/5.0):. Processed in 0.117647 secs); 14 Oct 2016 20:13:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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= X-Sasl-enc: vMGnfy2KU5LZCWUrmzsBaFSSyIp2uALdF5OlXbz4JKdT 1476476024 Date: Fri, 14 Oct 2016 20:12:00 +0000 From: Daniel Shahaf To: Zsh Users Subject: Re: Default true boolean zstyle Message-ID: <20161014201200.GB4531@fujitsu.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Fri, Oct 14, 2016 at 10:53:01 -0700: > On Thu, Oct 13, 2016 at 11:27 PM, Sebastian Gniazdowski > 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...