From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Cc: "Akinori -Aki- MUSHA" <knu@idaemons.org>
Subject: PATCH: Re: compdef's for FreeBSD
Date: Thu, 20 Apr 2000 11:44:08 +0200 (MET DST) [thread overview]
Message-ID: <200004200944.LAA27443@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Akinori -Aki- MUSHA"'s message of Wed, 19 Apr 2000 16:38:21 +0900
Akinori -Aki- MUSHA wrote:
> ...
>
> So here I attach some useful compdef's for FreeBSD environments, and
> we would be very happy if you would include them in your source tree
> for us.
I've re-hacked and added them.
Bye
Sven
Index: Completion/Bsd/.distfiles
===================================================================
RCS file: .distfiles
diff -N .distfiles
--- /dev/null Tue May 5 13:32:27 1998
+++ .distfiles Thu Apr 20 02:42:24 2000
@@ -0,0 +1,4 @@
+DISTFILES_SRC='
+ .distfiles
+ _bsd_pkg _cvsup _kld
+'
Index: Completion/Bsd/_bsd_pkg
===================================================================
RCS file: _bsd_pkg
diff -N _bsd_pkg
--- /dev/null Tue May 5 13:32:27 1998
+++ _bsd_pkg Thu Apr 20 02:42:24 2000
@@ -0,0 +1,68 @@
+#compdef pkg_add pkg_delete pkg_info
+
+(( $+functions[_bsd_pkg_packages] )) ||
+_bsd_pkg_packages() {
+ local ret=1 paths
+
+ paths=( "${(@)${(@s.:.)PKG_PATH}:#}" )
+ _files "$@" -g \*.tgz && ret=0
+ (( $#path )) && _files "$@" -W paths -g \*.tgz && ret=0
+ compadd "$@" - /usr/ports/packages/All/*.tgz && ret=0
+
+ return ret
+}
+
+_bsd_pkg() {
+ case "${words[1]:t}" in
+ pkg_add)
+ _arguments -s \
+ '-v[be verbose]' \
+ '-I[don'\''t execute installation scripts]' \
+ '-n[don'\''t really install packages]' \
+ '-R[don'\''t record]' \
+ '-r[use remote fetching]' \
+ '-f[force installation]' \
+ '-M[run in master mode]' \
+ '-S[run in slave mode]' \
+ '-t:mktemp template:_files -/' \
+ '-p:prefix directory:_files -/' \
+ '*:package to install:_bsd_pkg_packages'
+ ;;
+
+ pkg_delete)
+ _arguments -s \
+ '-v[be verbose]' \
+ '-D[don'\''t execute deinstallation scripts]' \
+ '-n[don'\''t really deinstall packages]' \
+ '-d[remove empty directories]' \
+ '-f[force deinstallation]' \
+ '-p:prefix directory:_files -/' \
+ '*:package to deinstall:compadd - /var/db/pkg/*(\:t)'
+ ;;
+
+ pkg_info)
+ _arguments -s \
+ '(:)-a[show all installed packages]' \
+ '-v[be verbose]' \
+ '-p[show installation prefixes]' \
+ '-q[be quiet]' \
+ '-c[show comment fields]' \
+ '-d[show long descriptions]' \
+ '-D[show install-message files]' \
+ '-f[show packing list instrcutions]' \
+ '-i[show install scripts]' \
+ '-I[show index lines]' \
+ '-k[show deinstall scripts]' \
+ '-r[show requirements scripts]' \
+ '-R[show list list of installed requiring packages]' \
+ '-m[show mtree files]' \
+ '-L[show full pathnames of files]' \
+ '-e[test if package is installed]:package name:compadd - /var/db/pkg/*(\:t)' \
+ '-l:prefix directory:_files -/' \
+ '-t:mktemp template:_files -/' \
+ '(-a)*:package name:compadd - /var/db/pkg/*(\:t)'
+ ;;
+ esac
+}
+
+[[ -o kshautoload ]] || _bsd_pkg "$@"
Index: Completion/Bsd/_cvsup
===================================================================
RCS file: _cvsup
diff -N _cvsup
--- /dev/null Tue May 5 13:32:27 1998
+++ _cvsup Thu Apr 20 02:42:24 2000
@@ -0,0 +1,27 @@
+#compdef cvsup
+
+_arguments -s \
+ '-1[disable automatic retries]' \
+ '-a[server must athenticate itself]' \
+ '-A:local adress:_hosts' \
+ '-b:base directory:_files -/' \
+ '-c:collections directory:_files -/' \
+ '-d:maximum number of deleted files:' \
+ '-D[perform only deletions]' \
+ '(-E)-e[enable execution of commands from server]' \
+ '(-e)-E[disable execution of commands from server]' \
+ '-g[disable use of GUI]' \
+ '-h:server host:_hosts' \
+ '-i:file pattern:' \
+ '-k[keep temporary copies of failed updates]' \
+ '-l:lock file:_files' \
+ '-L:verbosity level:(0 1 2)' \
+ '-p:port:_ports' \
+ '-P:connection mode:(m a port lo-hi -)' \
+ '-r:maximum number of retries:' \
+ '-s[suppress status checks]' \
+ '-v[print version information]' \
+ '(-Z)-z[enable compression]' \
+ '(-z)-Z[disable compression]' \
+ ':cvsup file:_files' \
+ ':destination directory:_files -/'
Index: Completion/Bsd/_kld
===================================================================
RCS file: _kld
diff -N _kld
--- /dev/null Tue May 5 13:32:27 1998
+++ _kld Thu Apr 20 02:42:24 2000
@@ -0,0 +1,41 @@
+#compdef kldload kldunload
+
+(( $+functions[_kld_module] )) ||
+_kld_module() {
+ local ret=1
+
+ compadd "$@" - /modules/*.ko(:t) && ret=0
+ _files "$@" -g \*.ko && ret=0
+
+ return ret
+}
+
+(( $+functions[_kld_unload] )) ||
+_kld_unload() {
+ compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $5 }' )
+}
+
+(( $+functions[_kld_unload_id] )) ||
+_kld_unload_id() {
+ compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $1 }' )
+}
+
+_kld() {
+ case "${words[1]:t}" in
+ kldload)
+ _arguments -s \
+ '-v[be verbose]' \
+ '*:module to load:_kld_module'
+ ;;
+
+ kldunload)
+ _arguments -s \
+ '-v[be verbose]' \
+ '(-n)-i:module id to unload:_kld_unload_id' \
+ '(-i)-n:module to unload:_kld_unload' \
+ '*:module to unload:_kld_unload'
+ ;;
+ esac
+}
+
+[[ -o kshautoload ]] || _kld "$@"
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-04-20 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-20 9:44 Sven Wischnowsky [this message]
2000-04-27 17:05 ` Akinori -Aki- MUSHA
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=200004200944.LAA27443@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=knu@idaemons.org \
--cc=zsh-workers@sunsite.auc.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).