summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2005-03-10 18:35:11 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2005-03-10 18:35:11 +0000
commitfde5350632961500e117e107671a2b830bd01183 (patch)
tree71e1762cf5f27a81fcf03752469d966e2cc034ab
parent43d480057b2255d4fc82cc4eded038bcea0b5cb6 (diff)
downloadzsh-fde5350632961500e117e107671a2b830bd01183.tar.gz
zsh-fde5350632961500e117e107671a2b830bd01183.tar.xz
zsh-fde5350632961500e117e107671a2b830bd01183.zip
20957: SVR4 and Solaris support
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_fuser55
2 files changed, 45 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index ddcd88691..f200124e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-10  Andrey Borzenkov  <bor@zsh.org>
+
+	* 20957: Completion/Unix/Command/_fuser:
+	Add support for Solaris and SVR4
+
 2005-03-10  Peter Stephenson  <pws@csr.com>
 
 	* 20959 (variant of 20958): Src/params.c, Src/Module/parameter.c,
diff --git a/Completion/Unix/Command/_fuser b/Completion/Unix/Command/_fuser
index db7695d9f..6cfbf407d 100644
--- a/Completion/Unix/Command/_fuser
+++ b/Completion/Unix/Command/_fuser
@@ -1,17 +1,42 @@
 #compdef fuser
 
-_arguments \
-       '(-s)-a[show all files specified on the command line]' \
-       {-c,-m}'[list all processes accessing files on the filesystem specified by name]' \
-       '-k[kill processes accessing the file]' \
-       '-i[ask for confirmation before killing]' \
-       '-l[list all known signal names]' \
-       '-n[select name space]:namespace:(file udp tcp)' \
-       '(-a)-s[silent operation]' \
-       '-signal[send alternate signal with -k]:signal:_signals' \
-       '-u[append the user name of the process owner to each PID]' \
-       '-v[verbose mode]' \
-       '-V[display version information]' \
-       '-4[search only for IPv4 sockets]' \
-       '-6[search only for IPv6 sockets]' \
-       ':name:_files'
+local -a args arg1
+
+if _pick_variant -c $words[1] gnu=GNU unix -V; then
+  _arguments \
+	 '(-s)-a[show all files specified on the command line]' \
+	 {-c,-m}'[list all processes accessing files on the filesystem specified by name]' \
+	 '-k[kill processes accessing the file]' \
+	 '-i[ask for confirmation before killing]' \
+	 '-l[list all known signal names]' \
+	 '-n[select name space]:namespace:(file udp tcp)' \
+	 '(-a)-s[silent operation]' \
+	 '-signal[send alternate signal with -k]:signal:_signals' \
+	 '-u[append the user name of the process owner to each PID]' \
+	 '-v[verbose mode]' \
+	 '-V[display version information]' \
+	 '-4[search only for IPv4 sockets]' \
+	 '-6[search only for IPv6 sockets]' \
+	 ':name:_files'
+else
+  case $OSTYPE in
+    solaris2.9 )
+      args=(
+	 '-n[list only processes with non-blocking mandatory locks]' 
+	 '-s[send alternate signal with -k]:signal:_signals' 
+      )
+    ;;
+    sysv4 )
+      arg1=( ':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]' \
+	 $args \
+	 $arg1 \
+	 ':name:_files'
+fi