Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: a new warning option
- X-seq: zsh-users 24335
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 15:41:41 +0200
- Cc: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GMwSHxXHH2K0NnbjQzhbqZGegigQCYkwMvHRDNLAWUA=; b=VcHQ8HjLJrmdFhJ1J6zA8i+I4rPZ5Kq7rQCYQ/EI5OG4l+ZTA1EqYrqB3+VAqibBGg kQ4gR1NzkzAwVAzcxRYtFd3fzQwd6DHQq5HpHBPK9axP3cvNrKvM12PsCkvLtNyPsTZv FQDZtmZUeEKFaXOx33YiclveQuaMYVPJrWK6v1ZUlk0banwKuPwbJh+EJni4usVosIPu BpkeNn4gqbcjyBVMmuERI0tY/H7RFSwWZgaCHsTH3MyU/iUear4JVShP4dpyjYyvxn9q c0D74WJiDsvTyeqV0bgO24zwPoovNc3vZ7LVlgdN24NE59PLKkPqOCFJfpkD8nYmdHrQ Egew==
- In-reply-to: <1570627441.5764.11.camel@samsung.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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDN-GspoiS-iVR5ThdbDVbLWVNJWcZ=TyY0=9ydtPswAw@mail.gmail.com> <CAN=4vMraXtTooeYfBDGObA7xVhoC6JpHRz1C3CUHKiW=LY8Nuw@mail.gmail.com> <CAKc7PVChNY2jjRW2TSw0c=V6yXv+5cp1OsgikihLv0iUi2+h=g@mail.gmail.com> <CAN=4vMq9uM_myMu55xjZ-+483JUY+VnmeEd4kCpOqBc8SurwFg@mail.gmail.com> <CGME20191009131852epcas2p368527332310d5197425b853f2a78e07d@epcas2p3.samsung.com> <CAKc7PVA+Ch+XqDj4aZRErr28Qo+0sejvt-d7F7m09YooC9psUg@mail.gmail.com> <1570627441.5764.11.camel@samsung.com>
On Wed, 9 Oct 2019 at 15:25, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
>
> Hmm... that's fair enough, but if you're happy to trade off against
> readability I think you have to take possible difficulties with the
> syntax on the chin...
I thought that:
[[ -z $ver ]] && ver="unknown (no .git/refs/heads/master)" || ver=${ver[1,7]}
is more or equally readable to:
if [[ -z $ver ]]; then
ver="unknown (no .git/refs/heads/master)"
else
ver=${ver[1,7]}
fi
especially if I would format it like I would today:
[[ -z $ver ]] && \
ver="unknown (no .git/refs/heads/master)" || \
ver=${ver[1,7]}
but I'm seeing your point. This is like commenting or not the code – I
was for a long long time pro-commenting, to just drop it recently,
actually finding pleasure in writing a condensed, I could agree –
(less /un)readable code.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author