From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16581 invoked from network); 7 Oct 2006 08:07:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Oct 2006 08:07:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46850 invoked from network); 7 Oct 2006 08:07:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 08:07:03 -0000 Received: (qmail 1578 invoked by alias); 7 Oct 2006 08:06:53 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10807 Received: (qmail 1567 invoked from network); 7 Oct 2006 08:06:52 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Oct 2006 08:06:52 -0000 Received: (qmail 45531 invoked from network); 7 Oct 2006 08:06:52 -0000 Received: from flock1.newmail.ru (80.68.241.157) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 08:06:51 -0000 Received: (qmail 28180 invoked from network); 7 Oct 2006 06:20:09 -0000 Received: from unknown (HELO cooker.local) (arvidjaar@newmail.ru@83.237.106.22) by smtpd.newmail.ru with SMTP; 7 Oct 2006 06:20:09 -0000 From: Andrey Borzenkov To: zsh-users@sunsite.dk Subject: Re: Move command line options to start of line Date: Sat, 7 Oct 2006 10:20:07 +0400 User-Agent: KMail/1.9.4 References: <200610061507.k96F7nU8000999@news01.csr.com> <061006195500.ZM29412@torch.brasslantern.com> In-Reply-To: <061006195500.ZM29412@torch.brasslantern.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610071020.08220.arvidjaar@newmail.ru> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 07 October 2006 06:55, Bart Schaefer wrote: > On Oct 6, 4:07pm, Peter Stephenson wrote: > } > } # This moves an option, possibly with arguments, from before the > } # cursor to immediately after the command word. > > Nice, but not precisely what David Korn had in mind. Given > > zsh% ls -s file1 file2 -l > > the result of the command should be > > zsh% ls -s -l file1 file2 > > and not > > zsh% ls -l -s file1 file2 > > I don't think this can be done without removing the trailing option and > its argument(s) from the line before finding the index of the place to > insert them again. (Sufficiently deeply nested expansion might still > accomplish this in a single replacement.) this apparently requires knowledge of arguments a given command accepts; this makes it rather hard to implement in general way. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFJ0cYR6LMutpd94wRAmc8AJ9mwaNtorSYF/GGhXbxi75CFxMG4wCfbl9j Rmqgim6+Vtwv7I11rrdEIN4= =UlMk -----END PGP SIGNATURE-----