From e7c9e03c58f04a04c35a0e4c3721f939ba5e58c2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 13 Jan 2009 12:09:26 +0000 Subject: 26301: make zpty -r exit more cleanly on bad reads add option -m to make zpty -r return status 1 if pattern failed to match use this option in comptest --- Doc/Zsh/mod_zpty.yo | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/mod_zpty.yo b/Doc/Zsh/mod_zpty.yo index 5a5459179..de471153e 100644 --- a/Doc/Zsh/mod_zpty.yo +++ b/Doc/Zsh/mod_zpty.yo @@ -38,7 +38,7 @@ Note that the command under the pseudo-terminal sees this input as if it were typed, so beware when sending special tty driver characters such as word-erase, line-kill, and end-of-file. ) -item(tt(zpty) tt(-r) [ tt(-t) ] var(name) [ var(param) [ var(pattern) ] ])( +item(tt(zpty) tt(-r) [ tt(-mt) ] var(name) [ var(param) [ var(pattern) ] ])( The tt(-r) option can be used to read the output of the command var(name). With only a var(name) argument, the output read is copied to the standard output. Unless the pseudo-terminal is non-blocking, copying continues @@ -54,10 +54,11 @@ one character is stored in var(param). If a var(pattern) is given as well, output is read until the whole string read matches the var(pattern), even in the non-blocking case. The return status is zero if the string read matches the pattern, or if the command -has exited but at least one character could still be read. As of this -writing, a maximum of one megabyte of output can be consumed this way; if -a full megabyte is read without matching the pattern, the return status is -non-zero. +has exited but at least one character could still be read. If the option +tt(-m) is present, the return status is zero only if the pattern matches. +As of this writing, a maximum of one megabyte of output can be consumed +this way; if a full megabyte is read without matching the pattern, the +return status is non-zero. In all cases, the return status is non-zero if nothing could be read, and is tt(2) if this is because the command has finished. -- cgit 1.4.1