about summary refs log tree commit diff
path: root/Completion/Bsd
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-20 09:45:04 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-20 09:45:04 +0000
commit4debe47da511d78f9bee5d26926308e640b7bc9f (patch)
tree7064956c52f8b3db7aca03e5d906405a12e551bf /Completion/Bsd
parentc9bedcd98923cd9890bd5d92ec5b0ada57bccc31 (diff)
downloadzsh-4debe47da511d78f9bee5d26926308e640b7bc9f.tar.gz
zsh-4debe47da511d78f9bee5d26926308e640b7bc9f.tar.xz
zsh-4debe47da511d78f9bee5d26926308e640b7bc9f.zip
new completions for FreeBSD commands (10861)
Diffstat (limited to 'Completion/Bsd')
-rw-r--r--Completion/Bsd/.distfiles4
-rw-r--r--Completion/Bsd/_bsd_pkg68
-rwxr-xr-xCompletion/Bsd/_cvsup27
-rw-r--r--Completion/Bsd/_kld41
4 files changed, 140 insertions, 0 deletions
diff --git a/Completion/Bsd/.distfiles b/Completion/Bsd/.distfiles
new file mode 100644
index 000000000..aef7ff380
--- /dev/null
+++ b/Completion/Bsd/.distfiles
@@ -0,0 +1,4 @@
+DISTFILES_SRC='
+    .distfiles
+    _bsd_pkg _cvsup _kld
+'
diff --git a/Completion/Bsd/_bsd_pkg b/Completion/Bsd/_bsd_pkg
new file mode 100644
index 000000000..0cdfd9c1e
--- /dev/null
+++ b/Completion/Bsd/_bsd_pkg
@@ -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 "$@"
diff --git a/Completion/Bsd/_cvsup b/Completion/Bsd/_cvsup
new file mode 100755
index 000000000..326fb722f
--- /dev/null
+++ b/Completion/Bsd/_cvsup
@@ -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 -/'
diff --git a/Completion/Bsd/_kld b/Completion/Bsd/_kld
new file mode 100644
index 000000000..065aa0c98
--- /dev/null
+++ b/Completion/Bsd/_kld
@@ -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 "$@"