about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2015-09-02 15:33:22 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2015-09-03 09:17:39 +0000
commit1ba2fac03d611ca2955e1c019c9cc9189fd2920b (patch)
treef89959f675d67234ef1d7ecb7985da9f820a27d3 /Src
parent8dfdca8afd77c39a2bb6542cfd20488059de09d1 (diff)
downloadzsh-1ba2fac03d611ca2955e1c019c9cc9189fd2920b.tar.gz
zsh-1ba2fac03d611ca2955e1c019c9cc9189fd2920b.tar.xz
zsh-1ba2fac03d611ca2955e1c019c9cc9189fd2920b.zip
36403: type -w += suffix alias
This makes 'type -w' distinguish suffix aliases from regular aliases,
like bare 'type' already does.

Use-case: detecting programmatically whether the command word is indeed
a valid command word (see <https://github.com/zsh-users/zsh-syntax-highlighting/issues/126>)
Diffstat (limited to 'Src')
-rw-r--r--Src/hashtable.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index 90739a882..2d1ff87cb 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1234,7 +1234,10 @@ printaliasnode(HashNode hn, int printflags)
     }
 
     if (printflags & PRINT_WHENCE_WORD) {
-	printf("%s: alias\n", a->node.nam);
+	if (a->node.flags & ALIAS_SUFFIX)
+	    printf("%s: suffix alias\n", a->node.nam);
+	else
+	    printf("%s: alias\n", a->node.nam);
 	return;
     }