diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2009-01-13 12:09:26 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2009-01-13 12:09:26 +0000 |
commit | e7c9e03c58f04a04c35a0e4c3721f939ba5e58c2 (patch) | |
tree | c526cf6141b9ca2aacd569b0a65628858a71eb61 /Doc | |
parent | e763f79b3f85f34edabf1e05304c757c8ef6f092 (diff) | |
download | zsh-e7c9e03c58f04a04c35a0e4c3721f939ba5e58c2.tar.gz zsh-e7c9e03c58f04a04c35a0e4c3721f939ba5e58c2.tar.xz zsh-e7c9e03c58f04a04c35a0e4c3721f939ba5e58c2.zip |
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
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/mod_zpty.yo | 11 |
1 files changed, 6 insertions, 5 deletions
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. |