From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11775 invoked from network); 22 Mar 2005 18:46:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Mar 2005 18:46:28 -0000 Received: (qmail 13007 invoked from network); 22 Mar 2005 18:46:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Mar 2005 18:46:21 -0000 Received: (qmail 7731 invoked by alias); 22 Mar 2005 18:46:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21051 Received: (qmail 7720 invoked from network); 22 Mar 2005 18:46:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Mar 2005 18:46:18 -0000 Received: (qmail 12706 invoked from network); 22 Mar 2005 18:46:18 -0000 Received: from morda.newmail.ru (HELO flock1.newmail.ru) (212.48.140.150) by a.mx.sunsite.dk with SMTP; 22 Mar 2005 18:46:14 -0000 Received: (qmail 1458 invoked from network); 22 Mar 2005 18:28:47 -0000 Received: from unknown (HELO ?10.0.0.1?) (arvidjaar@newmail.ru@83.237.61.202) by smtpd.newmail.ru with SMTP; 22 Mar 2005 18:28:47 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: [PATCH] _fuser Solaris and SVR4 support Date: Tue, 22 Mar 2005 21:46:11 +0300 User-Agent: KMail/1.7.2 References: <200503121046.54826.arvidjaar@newmail.ru> <9029.1111424918@trentino.groupinfra.com> In-Reply-To: <9029.1111424918@trentino.groupinfra.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503222146.12289.arvidjaar@newmail.ru> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 21 March 2005 20:08, Oliver Kiddle wrote: > On 12 Mar, Andrey wrote: > > I actually meant - signal names should be completed only if -k is present > > (because they are meaningless without). But currently it is possible to > > implement only using ->state and it seemed too much work for such small > > function. > > Normally we implement that by just checking for $+words[(r)-k] Oops. > Does the new patch below now do the right thing? > well, except at it turned out it was impossible to complete file name as first argument; also fuser takes more than one file. Is the following the right way to do it? - -andrey =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_fuser,v retrieving revision 1.2 diff -u -p -r1.2 _fuser - --- Completion/Unix/Command/_fuser 10 Mar 2005 18:38:16 -0000 1.2 +++ Completion/Unix/Command/_fuser 22 Mar 2005 13:16:45 -0000 @@ -27,7 +27,7 @@ else ) ;; sysv4 ) - - arg1=( ':signal:_signals -p' ) + (( $+words[(r)-k] )) && arg1=( ':signal: _alternative signals\:signals\:_signals\ -p files:files:_files' ) ;; esac @@ -38,5 +38,5 @@ else '-u[append the user name of the process owner to each PID]' \ $args \ $arg1 \ - - ':name:_files' + '*:name:_files' fi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCQGf0R6LMutpd94wRAmukAKC2NGrLVjGxAs/ezs8D8Fk+UD0fvACdHbFt 8IuJko+PJDQ0EhYXqmKyhqo= =bH6f -----END PGP SIGNATURE-----