2000-03-09 12:46:28 +01:00
|
|
|
#compdef zpty
|
|
|
|
|
2000-05-05 15:38:45 +02:00
|
|
|
local state line list names expl curcontext="$curcontext"
|
|
|
|
typeset -A opt_args
|
2000-03-09 12:46:28 +01:00
|
|
|
|
|
|
|
_arguments -C -s \
|
2000-05-25 17:09:04 +02:00
|
|
|
'(-r)*::args:_normal' \
|
|
|
|
- eb \
|
|
|
|
'-e[echo input characters]' \
|
|
|
|
'-b[io to pseudo-terminal blocking]' \
|
|
|
|
- d \
|
|
|
|
'-d[delete command]:*:name:->name' \
|
|
|
|
- w \
|
|
|
|
'-w[send string to command]:name:->name:*:strings to write' \
|
|
|
|
- L \
|
|
|
|
'-L[list defined commands as calls]' \
|
|
|
|
- r \
|
|
|
|
'(*)-r[read string from command]:name:->name:param:_parameters' && return 0
|
2000-03-09 12:46:28 +01:00
|
|
|
|
2000-04-11 09:57:56 +02:00
|
|
|
if [[ $state = name ]]; then
|
2000-05-25 17:09:04 +02:00
|
|
|
if ! zmodload -e zsh/zpty; then
|
|
|
|
_message "zpty module not loaded"
|
|
|
|
return 1
|
|
|
|
fi
|
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)"}#*\) }
|
2000-04-11 09:57:56 +02:00
|
|
|
_wanted names expl 'zpty command names' compadd -d list - "$names[@]"
|
2000-03-09 12:46:28 +01:00
|
|
|
else
|
2000-04-11 09:57:56 +02:00
|
|
|
_wanted names expl 'zpty command names' compadd - "$names[@]"
|
2000-03-09 12:46:28 +01:00
|
|
|
fi
|
|
|
|
fi
|