1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Completion/Builtins/_zpty

25 lines
874 B
Plaintext
Raw Normal View History

2000-03-09 12:46:28 +01:00
#compdef zpty
local state line list names expl curcontext="$curcontext"
typeset -A opt_args
2000-03-09 12:46:28 +01:00
_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' \
2000-04-01 22:43:43 +02:00
'(-e -b -d -w -L *)-r[read string from command]:name:->name:param:_parameters' \
2000-03-09 12:46:28 +01:00
'(-e -b -d -w -r)-L[list defined commands as calls]' \
'(-r)*::args:_normal' && return 0
2000-03-09 12:46:28 +01:00
if [[ $state = name ]]; then
2000-03-09 12:46:28 +01:00
list=( ${${(f)"$(zpty)"}#*\) } )
names=( ${list%%:*} )
if zstyle -T ":completion:${curcontext}" verbose; then
zformat -a list ' --' ${${(f)"$(zpty)"}#*\) }
_wanted names expl 'zpty command names' compadd -d list - "$names[@]"
2000-03-09 12:46:28 +01:00
else
_wanted names expl 'zpty command names' compadd - "$names[@]"
2000-03-09 12:46:28 +01:00
fi
fi