* PATCH: Re: compdef's for FreeBSD
@ 2000-04-20 9:44 Sven Wischnowsky
2000-04-27 17:05 ` Akinori -Aki- MUSHA
0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-04-20 9:44 UTC (permalink / raw)
To: zsh-workers; +Cc: Akinori -Aki- MUSHA
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: Re: compdef's for FreeBSD
2000-04-20 9:44 PATCH: Re: compdef's for FreeBSD Sven Wischnowsky
@ 2000-04-27 17:05 ` Akinori -Aki- MUSHA
0 siblings, 0 replies; 2+ messages in thread
From: Akinori -Aki- MUSHA @ 2000-04-27 17:05 UTC (permalink / raw)
To: wischnow; +Cc: zsh-workers
At Thu, 20 Apr 2000 11:44:08 +0200 (MET DST),
Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote:
> I've re-hacked and added them.
I'm very sorry for the late reply. I tested them and found it worked
perfectly. I'll ask other FreeBSD developers to check them, and send
you a feedback later.
We'd very much appreciate for your great work. Thank you so much!
--
/
/__ __
/ ) ) ) ) /
Akinori -Aki- MUSHA aka / (_ / ( (__( @ idaemons.org / FreeBSD.org
"We're only at home when we're on the run, on the wing, on the fly"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-04-27 17:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-20 9:44 PATCH: Re: compdef's for FreeBSD Sven Wischnowsky
2000-04-27 17:05 ` Akinori -Aki- MUSHA
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).