From 85ef41cdc801cbd80371c8d5fc11b991b29ae35e Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Mon, 29 Oct 2007 19:32:20 +0000 Subject: Merge of 22743: "set - [args]" -> "set -xv [-- args]" hack and limit it to non-native emulation. --- Doc/Zsh/builtins.yo | 4 ++++ Src/builtin.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 99b3238bd..ab12428fb 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1108,6 +1108,10 @@ positional parameters will be unset. If no arguments and no `tt(-)tt(-)' are given, then the names and values of all parameters are printed on the standard output. If the only argument is `tt(PLUS())', the names of all parameters are printed. + +For historical reasons, `tt(set -)' is treated as `tt(set +xv)' +and `tt(set -) var(args)' as `tt(set +xv --) var(args)' when in +any other emulation mode than zsh's native mode. ) module(setcap)(zsh/cap) findex(setopt) diff --git a/Src/builtin.c b/Src/builtin.c index 910d73f6d..2adecbe21 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -536,7 +536,7 @@ bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) /* Obsolescent sh compatibility: set - is the same as set +xv * * and set - args is the same as set +xv -- args */ - if (*args && **args == '-' && !args[0][1]) { + if (emulation != EMULATE_ZSH && *args && **args == '-' && !args[0][1]) { dosetopt(VERBOSE, 0, 0); dosetopt(XTRACE, 0, 0); if (!args[1]) -- cgit 1.4.1