Zsh Mailing List Archive
Messages sorted by:
Re: PATCH Re: 5.3: printf -
- X-seq: zsh-workers 40187
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: PATCH Re: 5.3: printf -
- Date: Wed, 14 Dec 2016 16:51:48 +0000
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=FMWB5FXhhsyuhZzmo9vbsM8vw58=; b=gopSOXIuWHTdcKnYu2+KT CglGAeD63sSYYLA/o3kC6XaPxytzb6qYlP3lgOpCheLYPZbIMq+j2JzOyV90kjmt 3caNVIPlNB0BWW3rDOrR4Ds+Irpk+rdoGWYc+xfgUFrx6Bg4ORflgK5wbI21rbh6 KFB+oZHmj56f0Mntv9N68k=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=FMWB5FXhhsyuhZzmo9vbsM8vw58=; b=NwNHJZi8nJzd8J0h/hL6 j6LnfqtNK+VBZntcGDXKPXTWDnsdHypaD2TnEupmr8tGJxwZVT2d0soo3mgfSMC9 /TP3Jfu9+ZtUeCaATJiEKXCDJNiL0PVwqSALKNCRBxqkmt+lyo0dZiqhqb5uAPss qkroKihrHV50eTHh2U1/2sE=
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161212234102.GB5457@fujitsu.shahaf.local2> <161212202110.ZM19667@torch.brasslantern.com> <CGME20161214044835epcas1p363f68aa2155487af59907b878d702464@epcas1p3.samsung.com> <161213204815.ZM24665@torch.brasslantern.com> <email@example.com>
Peter Stephenson wrote on Wed, Dec 14, 2016 at 09:39:22 +0000:
> On Tue, 13 Dec 2016 20:48:15 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > Apparently this was introduced in 37467 when I changed "printf" from
> > having no options at all to having the -v option for print-to-variable.
> > There's some documentation saying that ideally we would not create any
> > new builtins with BINF_SKIPINVALID but I don't see any other way to get
> > back the old behavior.
> This was in any case ignoring the vagaries of traditional shell
> behaviour, which demand inconsistency. Supporting printf -v but
> treating a - without a following alphanumeric as part of the string,
> which seem to be the requirements we're faced with, aren't really
> consistent. So I think anything that works goes here.
The grandparent patch fixes all the cases given so far in this thread,
except that «printf --» and «printf -- -» yield an error and "-",
respectively — whereas in sh mode they should both print "--".
I'd tried to split the printf logic out of bin_print() [lines 4648
through end of function] in order to pave the way for a separate
bin_printf(), but with little success.
Messages sorted by: