From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12030 invoked by alias); 11 May 2011 17:12:05 -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: 29232 Received: (qmail 29142 invoked from network); 11 May 2011 17:12:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=jUFHS/PSEmDtTi7/wjIyfeurnSNYvbCrbpF8dMhrXsA=; b=f7h2Ej2RCv0E8Ml08JjwSjg7DEZBd6PQ9AZQC6nAVh1IAo8087mJX/YZeaiTTVN2HH 2Fzjhp5zoq5aVJ+1Vaw5jN/PcHaARIDw6qUPtMq9yYFRPq7eRtVgFYRh8QPaQRgHrebO B4mTw3Yg2SiHnxx7s6Woe15uNZy340kJfZxD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=esPi1R7W9IRueYBSfprXotQa+6n2nExyeYSfIJpyw3NssEYOPaf7uWSXfr35gQeTU3 QLu9VN8nXNJx5cdpXtYdDfv1CFdzHJDA+AJacbHBNWfQBqrE+iFVYccEPtg2l4g2rnzK 9RF0XEAvC1TLIWrJKa58WNiz5Q6Xx39Jjj0rA= MIME-Version: 1.0 In-Reply-To: <110511094828.ZM24074@torch.brasslantern.com> References: <1305118971-25617-1-git-send-email-mikachu@gmail.com> <110511080327.ZM23776@torch.brasslantern.com> <110511090302.ZM23917@torch.brasslantern.com> <110511094828.ZM24074@torch.brasslantern.com> Date: Wed, 11 May 2011 19:11:58 +0200 Message-ID: Subject: Re: PATCH: expanding parameters like echo/print builtins From: Mikael Magnusson To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 11 May 2011 18:48, Bart Schaefer wrote: > On May 11, 6:22pm, Mikael Magnusson wrote: > } Subject: Re: PATCH: expanding parameters like echo/print builtins > } > } Do I need to clarify in the docs that you write g:: to give neither of > } the three flags? Just g by itself is an error, like for the other > } flags that take options. > > I don't think that's a problem, but yes it should be doc'd. > > BTW, the construct "... the exception of the next sentence. In none > of these modes ..." is a little clunky; probably OK to just say "... > except that in none of these modes ..." How's this? item(tt(g:opts:))( Expand words like the echo builtin when no options are given (tt(g::)). With the tt(o) option, octal escapes don't take a leading zero. With the tt(c) option, sequences like `tt(^X)' are interpreted. With the tt(e) option, interprets `tt(\M-t)' and similar sequences like the print builtin. With both of the tt(o) and tt(e) options, behaves like the print builtin except that in none of these modes is `tt(\c)' interpreted. ) And this for s, separator var(string). Note that a var(string) of two or more characters means that all of them must match in sequence; this differs from the treatment of two or more characters in the tt(IFS) parameter. -See also the tt(=) flag and the tt(SH_WORD_SPLIT) option. +See also the tt(=) flag and the tt(SH_WORD_SPLIT) option. An empty +string may also be given in which case every character will be a separate +element. > } for this flag there are a limited number of options, so : could be > } obligatory for the field separator, then you could say just (g). Does > } anyone care about this? :) (It would also mean we can't use : as a new > } flag though). > > I don't like the idea of limiting the delimiter to ":". Okay, I guess I don't really either. > RE Oliver's suggestion of a (\) flag -- I considered that too but it > is not clear whether the backslash might be removed in some contexts > before zsh gets around to parsing the flags. > > I suppose we could use (/) (to mean "reverse the backslashes"?) but ... ${(/::) looks like an alien girl waving goodbye. :) -- Mikael Magnusson