Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] _fuser Solaris and SVR4 support



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]
Does the new patch below now do the right thing?

> Will "prerequisite options" be generally useful? I.e. something like
> 
> [-a]-b:....

They would. But changing _arguments isn't exactly easy. An alternative
syntax might be something like (!-a), mixing them with the exclusion
lists.

Oliver

Index: Completion/Unix/Command/_fuser
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_fuser,v
retrieving revision 1.2
diff -u -r1.2 _fuser
--- Completion/Unix/Command/_fuser	10 Mar 2005 18:38:16 -0000	1.2
+++ Completion/Unix/Command/_fuser	21 Mar 2005 17:02:20 -0000
@@ -27,7 +27,7 @@
       )
     ;;
     sysv4 )
-      arg1=( ':signal:_signals -p' )
+      (( $+words[(r)-k] )) && arg1=( ':signal:_signals -p' )
     ;;
   esac
 



Messages sorted by: Reverse Date, Date, Thread, Author