From 77a39b57bf467812b9219ae6a84f2f71e6a50065 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 24 Nov 2017 22:09:41 +0000 Subject: 42031 + 42048: Make [[ -o invalidoption ]] a normal(ish) false value, rather than a syntax error. --- Doc/Zsh/cond.yo | 4 ++++ Doc/Zsh/options.yo | 3 +++ 2 files changed, 7 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo index e08fc0d36..4ca132a26 100644 --- a/Doc/Zsh/cond.yo +++ b/Doc/Zsh/cond.yo @@ -45,6 +45,10 @@ 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).) + +When no option named var(option) exists, and the tt(POSIX_BUILTINS) option +hasn't been set, return 3 with a warning. If that option is set, return 1 +with no warning. ) item(tt(-p) var(file))( true if var(file) exists and is a FIFO special file (named pipe). diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 28155d796..d043cf398 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -2169,6 +2169,9 @@ command found in the path. Furthermore, the tt(getopts) builtin behaves in a POSIX-compatible fashion in that the associated variable tt(OPTIND) is not made local to functions. + +Moreover, the warning and special exit code from +tt([[ -o )var(non_existent_option)tt( ]]) are suppressed. ) pindex(POSIX_IDENTIFIERS) pindex(NO_POSIX_IDENTIFIERS) -- cgit 1.4.1