Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 5.3: printf -
- X-seq: zsh-workers 40172
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: 5.3: printf -
- Date: Tue, 13 Dec 2016 06:25:31 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=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=gV1DyL24Fsp8xI/8H3Jlnwxdo6g=; b=vb+TgSYorGq2v3AmuIScP HVj59i/ZMWMfGowFXLepO1QdmzONJdV+Qa4EzTX6RNWAy01P9X8iA5VNhcOZ2TE8 H/c5c29XWsDSuSE1dQO60YGMpcXKyQTH0bV+wYFWw9Q70mlCHKua82xvc34UcZRG stoV8jhTEryjOD0rcvhoDw=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=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=gV1DyL24Fsp8xI/8H3Jlnwxdo6g=; b=OzTIuvdnJkAeVWssjJV1 SCXVifQNL2YlXOgj9SLt61CvNjb3vOE+oij3y9DZr6BwhscpSXro1GU0B2sK2NWN 0OB+FGvw7xDepZlO8aOLj+809dhY13Wtgq9iKP+emF005ZJ19Z4/B2yyQoRYWQz5 JAQ4y4/OaEBVcCBtqwXp0WQ=
- In-reply-to: <161212202110.ZM19667@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161212234102.GB5457@fujitsu.shahaf.local2> <161212202110.ZM19667@torch.brasslantern.com>
Bart Schaefer wrote on Mon, Dec 12, 2016 at 20:21:10 -0800:
> On Dec 12, 11:41pm, Daniel Shahaf wrote:
> }
> } % printf -
> } printf: not enough arguments
> }
> } Happens in sh mode too. dash and bash [that's what I have handy] print
> } a minus sign.
>
> I was going to blame this on zsh generally treating a single "-" like
> "--" in argument lists (which is documented), but something is fishy:
>
> torch% printf -- --
> printf: not enough arguments
> torch% printf - -
> -%
> torch% printf - --
> printf: not enough arguments
> torch% printf -- -
> -%
> torch% printf -- -- --
> --%
I think these should:
• In sh mode, emit argv[1] and ignore the others: it is the format
string even if it happens to start with a minus.
• In zsh mode, interpret argv[1] as end-of-options, then emit argv[2]
and ignore any other arguments: argv[2] is the format string.
Another case: «printf -x».
> ("%" there is PROMPT_SP of course).
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author