From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12423 invoked by alias); 4 Sep 2014 03:18:58 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33107 Received: (qmail 29155 invoked from network); 4 Sep 2014 03:18:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140903201824.ZM16856@torch.brasslantern.com> Date: Wed, 03 Sep 2014 20:18:24 -0700 In-reply-to: <20140903161418.3f79636b@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: The ~ parameter expansion flag: bug or misunderstanding" (Sep 3, 4:14pm) References: <20140903161418.3f79636b@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: The ~ parameter expansion flag: bug or misunderstanding MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 3, 4:14pm, Peter Stephenson wrote: } } The documentation isn't very clear While we're sort of on the subject, the (l) and (r) padding flags say: The arguments :STRING1: and :STRING2: are optional; neither, the first, or both may be given. Note that the same pairs of delimiters must be used for each of the three arguments. The space to the left will be filled with STRING1 (concatenated as often as needed) or spaces if STRING1 is not given. If both STRING1 and STRING2 are given, string2 is inserted once directly to the left of each word, truncated if necessary, before STRING1 is used to produce any remaining padding. What this doesn't say is that if STRING2 is the empty string, a space is inserted instead: torch% f=f torch% print X${(l:2::.:)f}X X.fX torch% print X${(l:2::.:::)f}X X fX torch% print X${(l:5::.:::)f}X X... fX torch% print X${(l:5::.::+:)f}X X...+fX I'm not sure if that's a bug, or intentional. Of course one might ask why one would bother with the empty :: when it could simply be left out.