From: Andrey Borzenkov <arvidjaar@mail.ru>
To: zsh-workers@sunsite.dk
Subject: [PATCH] _fuser Solaris and SVR4 support
Date: Thu, 10 Mar 2005 18:04:16 +0300 [thread overview]
Message-ID: <E1D9PCy-000Gis-00.arvidjaar-mail-ru@f9.mail.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
I have access to Solaris 9 only so please extend this with
other versions (BTW Solaris 10 is now 5.10 not 2.10).
Completion for SVR4 is not quite right - it should complete
signal names only after -k, but it seems to be too much work.
-andrey
[-- Attachment #2: _fuser.diff --]
[-- Type: text/plain, Size: 2428 bytes --]
Index: Completion/Unix/Command/_fuser
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_fuser,v
retrieving revision 1.1
diff -u -r1.1 _fuser
--- Completion/Unix/Command/_fuser 7 Mar 2005 02:52:30 -0000 1.1
+++ Completion/Unix/Command/_fuser 10 Mar 2005 14:58:43 -0000
@@ -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
next reply other threads:[~2005-03-10 15:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-10 15:04 Andrey Borzenkov [this message]
2005-03-11 9:37 ` Oliver Kiddle
2005-03-12 7:46 ` Andrey Borzenkov
2005-03-21 17:08 ` Oliver Kiddle
2005-03-22 18:46 ` Andrey Borzenkov
2005-03-22 19:28 ` Oliver Kiddle
2005-03-11 10:47 ` Danek Duvall
2005-03-11 11:15 ` Oliver Kiddle
2005-03-12 7:53 ` Andrey Borzenkov
2005-03-12 7:55 ` Andrey Borzenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1D9PCy-000Gis-00.arvidjaar-mail-ru@f9.mail.ru \
--to=arvidjaar@mail.ru \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).