diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo index e08fc0d..0ea5fc1 100644 --- a/Doc/Zsh/cond.yo +++ b/Doc/Zsh/cond.yo @@ -45,6 +45,8 @@ item(tt(-o) var(option))( true if option named var(option) is on. var(option) may be a single character, in which case it is a single letter option name. (See noderef(Specifying Options).) +If the var(option) does not exist, the shell exits with an error message, +unless the shell option tt(POSIX_BUILTINS) is set. ) item(tt(-p) var(file))( true if var(file) exists and is a FIFO special file (named pipe). diff --git a/Src/cond.c b/Src/cond.c index b9a47ce..814f4b0 100644 --- a/Src/cond.c +++ b/Src/cond.c @@ -506,6 +506,8 @@ optison(char *name, char *s) else i = optlookup(s); if (!i) { + if (isset(POSIXBUILTINS)) + return 1; /* act like bash and *ksh */ zwarnnam(name, "no such option: %s", s); return 2; } else if(i < 0)