summary refs log tree commit diff
path: root/Completion/Builtins
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-22 12:35:29 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-22 12:35:29 +0000
commit02f0009e5ac853efc6a3bc76faf65eba37f38aab (patch)
tree0d12a5fc101fc05d1cea716f6bf08d957e04d72b /Completion/Builtins
parent4a662b72f11398d648ea65644cd6416176d7241d (diff)
downloadzsh-02f0009e5ac853efc6a3bc76faf65eba37f38aab.tar.gz
zsh-02f0009e5ac853efc6a3bc76faf65eba37f38aab.tar.xz
zsh-02f0009e5ac853efc6a3bc76faf65eba37f38aab.zip
Initial revision
Diffstat (limited to 'Completion/Builtins')
-rw-r--r--Completion/Builtins/_compdef22
1 files changed, 22 insertions, 0 deletions
diff --git a/Completion/Builtins/_compdef b/Completion/Builtins/_compdef
new file mode 100644
index 000000000..1df5758b3
--- /dev/null
+++ b/Completion/Builtins/_compdef
@@ -0,0 +1,22 @@
+#compdef compdef
+
+local func base=2
+
+while [[ $words[base] = -* ]]; do
+  case $words[base] in
+    -d) delete=yes ;;
+    -p) type=pattern ;;
+    -k) type=key ;;
+  esac  
+  (( base++ ))
+done
+
+if [ "$delete" ]; then
+  compadd ${(k)_comps}
+else
+  if [[ CURRENT -eq base  ]]; then
+    for func in ${^~fpath:/.}/_(|*[^~])(N:t); compadd -P_ - ${func#_}
+  else
+    compgen -c
+  fi
+fi