mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
18908: use print/read -u in completion system and tweak builtin doc
This commit is contained in:
parent
adf2c2a0b6
commit
0f080f741c
6 changed files with 16 additions and 9 deletions
|
@ -1,3 +1,10 @@
|
|||
2003-07-25 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 18908: Doc/Zsh/builtins.yo, Functions/TCP/tcp_fd_handler,
|
||||
Functions/TCP/tcp_read, Functions/TCP/tcp_send,
|
||||
Functions/TCP/tcp_sess: Use print/read -u for supplying fd's.
|
||||
Tweak documentation for print/read -u for consistency.
|
||||
|
||||
2003-07-24 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 18901: baptiste daroussin (and Nikolai Weibull, 18894):
|
||||
|
|
|
@ -657,7 +657,7 @@ If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and
|
|||
`tt(-)' in this context are swapped.
|
||||
)
|
||||
findex(print)
|
||||
xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u)var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ])
|
||||
xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ])
|
||||
item( [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])(
|
||||
With the `tt(-f)' option the arguments are printed as described by tt(printf).
|
||||
With no flags or with the flag `tt(-)', the arguments are printed on
|
||||
|
@ -738,7 +738,7 @@ tt(-R); all other arguments and options are printed.
|
|||
item(tt(-s))(
|
||||
Place the results in the history list instead of on the standard output.
|
||||
)
|
||||
item(tt(-u)var(n))(
|
||||
item(tt(-u) var(n))(
|
||||
Print the arguments to file descriptor var(n).
|
||||
)
|
||||
item(tt(-z))(
|
||||
|
@ -827,7 +827,7 @@ alias(r)(fc -e -)
|
|||
findex(read)
|
||||
vindex(IFS, use of)
|
||||
ifzman(xitem(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]))
|
||||
item(ifnzman(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]) [ tt(-u)var(n) ] [ var(name)[tt(?)var(prompt)] ] [ var(name) ... ])(
|
||||
item(ifnzman(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]) [ tt(-u) var(n) ] [ var(name)[tt(?)var(prompt)] ] [ var(name) ... ])(
|
||||
vindex(REPLY, use of)
|
||||
vindex(reply, use of)
|
||||
Read one line and break it into fields using the characters
|
||||
|
@ -895,7 +895,7 @@ read. Note that the command name is word number 1, not word 0,
|
|||
and that when the cursor is at the end of the line, its character
|
||||
index is the length of the line plus one.
|
||||
)
|
||||
item(tt(-u)var(n))(
|
||||
item(tt(-u) var(n))(
|
||||
Input is read from file descriptor var(n).
|
||||
)
|
||||
item(tt(-p))(
|
||||
|
|
|
@ -20,14 +20,14 @@ else
|
|||
zle -I
|
||||
# Handle fds not in the TCP set similarly.
|
||||
# This does the drain thing, to try and get as much data out as possible.
|
||||
if ! read line <&$1; then
|
||||
if ! read -u $1 line; then
|
||||
print "[Reading on $1 failed; removing from poll list]" >& 2
|
||||
zle -F $1
|
||||
return 1
|
||||
fi
|
||||
line="fd$1:$line"
|
||||
local newline
|
||||
while read -t newline <&$1; do
|
||||
while read -u $1 -t newline; do
|
||||
line="${line}
|
||||
fd$1:$newline"
|
||||
done
|
||||
|
|
|
@ -190,7 +190,7 @@ while (( ${#read_fds} )); do
|
|||
print "[tcp_read: returned fds ${reply}]" >&2
|
||||
fi
|
||||
for read_fd in ${reply[2,-1]}; do
|
||||
if ! read -r line <&$read_fd; then
|
||||
if ! read -u $read_fd -r line; then
|
||||
unset "read_fds[$read_fd]"
|
||||
stat=1
|
||||
continue
|
||||
|
|
|
@ -62,7 +62,7 @@ for TCP_SESS in $sessions; do
|
|||
mystat=1
|
||||
continue
|
||||
fi
|
||||
print $nonewline -r -- $* >&$fd
|
||||
print -u $fd $nonewline -r -- $*
|
||||
if [[ $? -ne 0 || -n $TCP_FD_CLOSED ]]; then
|
||||
print "Session ${TCP_SESS}: fd $fd unusable." >&2
|
||||
unset TCP_FD_CLOSED
|
||||
|
|
|
@ -33,7 +33,7 @@ for name in ${(ko)tcp_by_name}; do
|
|||
else
|
||||
cur=
|
||||
fi
|
||||
print "sess:$name; fd:$fd$cur" >&$__myfd
|
||||
print -u $__myfd "sess:$name; fd:$fd$cur"
|
||||
done
|
||||
|
||||
return $(( __myfd - 1 ))
|
||||
|
|
Loading…
Reference in a new issue