about summary refs log tree commit diff
path: root/Completion/Builtins
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-09 11:46:28 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-09 11:46:28 +0000
commit768d5fc7dc33c9c4fe166827b31d785084d5e311 (patch)
tree385841f70be3f79a8abc121e2cc75004fb0dc348 /Completion/Builtins
parentba4f71f3f7f8a93a25f5069a110ca0e44035efd4 (diff)
downloadzsh-768d5fc7dc33c9c4fe166827b31d785084d5e311.tar.gz
zsh-768d5fc7dc33c9c4fe166827b31d785084d5e311.tar.xz
zsh-768d5fc7dc33c9c4fe166827b31d785084d5e311.zip
Initial revision
Diffstat (limited to 'Completion/Builtins')
-rw-r--r--Completion/Builtins/_zpty23
1 files changed, 23 insertions, 0 deletions
diff --git a/Completion/Builtins/_zpty b/Completion/Builtins/_zpty
new file mode 100644
index 000000000..b197b4128
--- /dev/null
+++ b/Completion/Builtins/_zpty
@@ -0,0 +1,23 @@
+#compdef zpty
+
+local state line list names expl
+
+_arguments -C -s \
+  '(-d -w -r -L)-e[echo input characters]' \
+  '(-d -w -r -L)-b[io to pseudo-terminal blocking]' \
+  '(-e -b -w -r -L)-d[delete command]:*:name:->name' \
+  '(-e -b -d -r -L)-w[send string to command]:name:->name:*:strings to write' \
+  '(-e -b -d -w -L)-r[read string from command]:name:->name:param:_parameters:*:nothing:_nothing' \
+  '(-e -b -d -w -r)-L[list defined commands as calls]' \
+  '*::args:_normal'
+
+if [[ $state = name ]] && _wanted zptynames expl 'zpty command names'; then
+  list=( ${${(f)"$(zpty)"}#*\) } )
+  names=( ${list%%:*} )
+  if zstyle -T ":completion:${curcontext}" verbose; then
+    zformat -a list ' --' ${${(f)"$(zpty)"}#*\) }
+    compadd "$expl[@]" -d list - "$names[@]"
+  else
+    compadd "$expl[@]" - "$names[@]"
+  fi
+fi