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

Re: [PATCH] _fuser Solaris and SVR4 support



Andrey wrote:
> I have access to Solaris 9 only so please extend this with
> other versions (BTW Solaris 10 is now 5.10 not 2.10).

Solaris 8 only has the basic set of options so no changes are needed for
it and, presumably, earlier versions.

> Completion for SVR4 is not quite right - it should complete
> signal names only after -k, but it seems to be too much work.

It isn't too hard and it is always very annoying to break file
completion (as this does for Solaris). Does this patch do the right
thing?

Oliver

Index: _fuser
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_fuser,v
retrieving revision 1.2
diff -u -r1.2 _fuser
--- _fuser	10 Mar 2005 18:38:16 -0000	1.2
+++ _fuser	11 Mar 2005 09:31:04 -0000
@@ -1,6 +1,6 @@
 #compdef fuser
 
-local -a args arg1
+local -a args kopt
 
 if _pick_variant -c $words[1] gnu=GNU unix -V; then
   _arguments \
@@ -19,6 +19,7 @@
 	 '-6[search only for IPv6 sockets]' \
 	 ':name:_files'
 else
+  kopt='-k[kill processes accessing the file]'
   case $OSTYPE in
     solaris2.9 )
       args=(
@@ -27,16 +28,15 @@
       )
     ;;
     sysv4 )
-      arg1=( ':signal:_signals -p' )
+      kopt+=':signal:_signals -p'
     ;;
   esac
 
   _arguments \
 	 '(-f)-c[list all processes accessing files on the filesystem specified by name]' \
 	 '(-c)-f[list all processes accessing named files]' \
-	 '-k[kill processes accessing the file]' \
 	 '-u[append the user name of the process owner to each PID]' \
+	 $kopt \
 	 $args \
-	 $arg1 \
 	 ':name:_files'
 fi



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