Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: whence -S but not for which or where



On Tue, 20 Jan 2015 17:53:19 +0100
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Was it intentional or an oversight that the new -S option does not apply
> to the which and where builtin commands?

Neither; they simply didn't come into the picture at the time.

As they support -S, there's no reason why they shouldn't also be
extended.

pws

diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 49c2c11..dc39371 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -2139,11 +2139,11 @@ symlink resolved at each step might be anywhere in the path.
 enditem()
 )
 findex(where)
-item(tt(where) [ tt(-wpms) ] var(name) ...)(
+item(tt(where) [ tt(-wpmsS) ] var(name) ...)(
 Equivalent to tt(whence -ca).
 )
 findex(which)
-item(tt(which) [ tt(-wpams) ] var(name) ...)(
+item(tt(which) [ tt(-wpamsS) ] var(name) ...)(
 Equivalent to tt(whence -c).
 )
 findex(zcompile)
diff --git a/Src/builtin.c b/Src/builtin.c
index 9258ddb..1818941 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -129,8 +129,8 @@ static struct builtin builtins[] =
     BUILTIN("unsetopt", 0, bin_setopt, 0, -1, BIN_UNSETOPT, NULL, NULL),
     BUILTIN("wait", 0, bin_fg, 0, -1, BIN_WAIT, NULL, NULL),
     BUILTIN("whence", 0, bin_whence, 0, -1, 0, "acmpvfsSw", NULL),
-    BUILTIN("where", 0, bin_whence, 0, -1, 0, "pmsw", "ca"),
-    BUILTIN("which", 0, bin_whence, 0, -1, 0, "ampsw", "c"),
+    BUILTIN("where", 0, bin_whence, 0, -1, 0, "pmsSw", "ca"),
+    BUILTIN("which", 0, bin_whence, 0, -1, 0, "ampsSw", "c"),
     BUILTIN("zmodload", 0, bin_zmodload, 0, -1, 0, "AFRILP:abcfdilmpue", NULL),
     BUILTIN("zcompile", 0, bin_zcompile, 0, -1, 0, "tUMRcmzka", NULL),
 };



Messages sorted by: Reverse Date, Date, Thread, Author