about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Completion/BSD/Command/_bsd_pkg45
-rw-r--r--Completion/Unix/Command/_bzip259
3 files changed, 111 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ad21af73..940219711 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-09-26  Oliver Kiddle  <opk@zsh.org>
+
+	* unposted: Completion/Unix/Command/_bzip2: recognise also .tbz
+	and .tbz2 files
+
+	* Akinori Musha: 17719: Completion/BSD/Command/_bsd_pkg: add
+	support for the	pkg_create command
+
 2002-09-19  Bart Schaefer  <schaefer@zsh.org>
 
 	* 17692: Src/builtin.c: Prevent typeset of a positional parameter
diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg
index 81b187134..adb93c0d1 100644
--- a/Completion/BSD/Command/_bsd_pkg
+++ b/Completion/BSD/Command/_bsd_pkg
@@ -1,4 +1,4 @@
-#compdef pkg_add pkg_delete pkg_info
+#compdef pkg_add pkg_create pkg_delete pkg_info
 
 (( $+functions[_bsd_pkg_pkgfiles] )) ||
 _bsd_pkg_pkgfiles() {
@@ -79,6 +79,49 @@ _bsd_pkg() {
       '*:package to install:_bsd_pkg_pkgfiles'
     ;;
 
+  pkg_create)
+    case "$OSTYPE" in
+    freebsd*)
+      flags=(
+	'-f[specify plist file]:plist file:_files'
+	'(-b)-c[specify comment file]:comment file:_files'
+	'(-b)-d[specify descr file]:descr file:_files'
+	'-Y[assume YES for any questions asked]'
+	'-N[assume NO for any questions asked]'
+	'(-b)-O[packing list only mode]'
+	'-v[be verbose]'
+	'-h[force tar to follow symlinks]'
+	'(-b)-i[specify pre-install script]:pre-install script:_files'
+	'(-b)-I[specify post-install script]:post-install script:_files'
+	'(-b)-P[specify initial dependencies]:dependencies:_bsd_pkg_pkgs'
+	'(-b)-p[specify prefix]:prefix directory:_files -/'
+	'(-b)-k[specify deinstall script]:deinstall script:_files'
+	'(-b)-K[specify post-deinstall script]:post-deinstall script:_files'
+	'(-b)-r[specify req script]:req script:_files'
+	'(-b)-s[specify source directory]:source directory:_files -/'
+	'(-b)-t[specify mktemp template]:mktemp template:_files'
+	'(-b)-X[specify exclude file]:exclude file for tar:_files'
+	'(-b)-D[specify message file]:message file:_files'
+	'(-b)-m[specify mtree file]:mtree file:_files'
+	'(-b)-o[specify origin]:origin:_files -W ${PORTSDIR\:-/usr/ports} -/'
+	'-j[use bzip2]'
+	'-z[use gzip]'
+	'(-c -d -O -i -I -P -p -k -K -r -s -t -X -D -m -o)-b[specify pkgname]:pkgname:_bsd_pkg_pkgs'
+	'*:package file name:_files'
+      )
+      ;;
+    netbsd*)
+      # NetBSD users, improve me!
+      flags=(
+	'*:package name:_bsd_pkg_pkgs'
+      )
+      ;;
+    esac
+
+    _arguments -s \
+      $flags[@]
+      ;;
+
   pkg_delete)
     flags=(
       '-D[don'\''t execute deinstallation scripts]'
diff --git a/Completion/Unix/Command/_bzip2 b/Completion/Unix/Command/_bzip2
new file mode 100644
index 000000000..160d77b2d
--- /dev/null
+++ b/Completion/Unix/Command/_bzip2
@@ -0,0 +1,59 @@
+#compdef bzip2 bunzip2 bzcat=bunzip2 bzip2recover
+
+local decompress expl state line curcontext="$curcontext"
+typeset -A opt_args
+
+case "$service" in
+  bzip2recover) [[ $CURRENT = 2 ]] && state=files;;
+  bzip2) decompress=no;&
+  bunzip2) _arguments -C -s -S \
+    '(--help)-h[display help message]' \
+    '(-h)--help[display help message]' \
+    '(--decompress --compress -z --test -t)-d[decompress]' \
+    '(-d --compress -z --test -t)--decompress[decompress]' \
+    '(--compress --decompress -d --test -t)-z[compress]' \
+    '(-z --decompress -d --test -t)--compress[compress]' \
+    "(--keep)-k[keep (don't delete) input files]" \
+    "(-k)--keep[keep (don't delete) input files]" \
+    '(--force)-f[force overwrite]' \
+    '(-f)--force[force overwrite]' \
+    '(--test --decompress -d --compress -z )-t[test compressed file integrity]' \
+    '(-t --decompress -d --compress -z )--test[test compressed file integrity]' \
+    '(--stdout)-c[write on standard output]' \
+    '(-c)--stdout[write on standard output]' \
+    '(--quiet)-q[suppress all warnings]' \
+    '(-q)--quiet[suppress all warnings]' \
+    '*-v[verbose mode]' \
+    '*--verbose[verbose mode]' \
+    '(--license)-L[display software license]' \
+    '(-L)--license[display software license]' \
+    '(--version)-V[display version number]' \
+    '(-V)--version[display version number]' \
+    '(--small)-s[use less memory (at most 2500k)]' \
+    '(   -2 -3 -4 -5 -6 -7 -8 -9)-1' \
+    '(-1    -3 -4 -5 -6 -7 -8 -9)-2' \
+    '(-1 -2    -4 -5 -6 -7 -8 -9)-3' \
+    '(-1 -2 -3    -5 -6 -7 -8 -9)-4' \
+    '(-1 -2 -3 -4    -6 -7 -8 -9)-5' \
+    '(-1 -2 -3 -4 -5	-7 -8 -9)-6' \
+    '(-1 -2 -3 -4 -5 -6    -8 -9)-7' \
+    '(-1 -2 -3 -4 -5 -6 -7    -9)-8' \
+    '(-1 -2 -3 -4 -5 -6 -7 -8	)-9' \
+    '*:files:->files' && return 0
+  ;;
+esac
+
+if [[ "$state" = files ]]; then
+  (( $+opt_args[-z] || $+opt_args[--compress] )) && decompress=no
+  (( $+opt_args[-d] || $+opt_args[--decompress] || $+opt_args[-t] ||
+      $+opt_args[--test] )) && unset decompress
+  if [[ -z "$decompress" ]]; then
+    _description files expl 'compressed file'
+    _files "$expl[@]" -g '*.(bz2|tbz|tbz2)' && return 0
+  else
+    _description files expl 'file to compress'
+    _files "$expl[@]" -g '*~*.(bz2|tbz|tbz2)' && return 0
+  fi
+fi
+
+return 1