Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] type -w += global aliases
- X-seq: zsh-workers 42146
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] type -w += global aliases
- Date: Wed, 20 Dec 2017 05:36:12 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=9Xjj8y619Zt8roBX5 QsWR+jv58ee/CLj+mbBInrSLzA=; b=JoPnJsfJw7sH9rKrvwbY1XJIq1uShXs/2 HdiaScU0zZEnY+MoIXQFVLLLuUCXsntLkh/yP6CMER61lgDutF2wHfGDe1qP9VPe NIYvaLQcCH3DjuqhOYrcVtFeL0faoBQ8jzkbsPAQx6Qdrhsh0yd6/27WzLvV9Tsh nXvhc46pTJwwHLoe5Z00RxewOA6mNEEIZlCuxy/ogzw1FrgIL/L1dWlrDNMzy3+s +DAuzuDaALYIiasrsyfkIMsRBp0YgRwj5n2QYX+PNM8eKOdJKc6GEsbvBgIdBwUF It5YWZB6ydnQFg9XNjw0gidbp9DCMLo6QooT5v+2WRes/Z8DtDjsQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=9Xjj8y619Zt8roBX5 QsWR+jv58ee/CLj+mbBInrSLzA=; b=QflVAQTaKHa/VOhrF4tYEUfHX1AtdBa26 0nBA+svyuwaK3qDEflHEowgKbgabfVgf4p+Za4H5TiWbNoZX/KTHS1RUdhl+Af6f vtvN+8Fda+QJmak7sUCH0CSEjogdPFgt/Mj4fmLZ8EIGhciDOpukO+zXwqznQO21 /pAh2MWA5GqzVWt/7URLKN5NVC4MljdiUt2gPaRENIphn1UURblNLYQXasrtU/Eh uxU4NYXfYrts7Pl+jXUe653vV6yLngogALDJnd2KrLmNmTOlvB7CHTmYcBht6iyl qlUzfOny70SJ5R4MKFYyaNwLDKHAYbpM/WZwSlrDKrm/VVwHri4TQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Follow-up to 36403, which did the same for suffix aliases.
---
Src/hashtable.c | 2 ++
Test/A02alias.ztst | 11 +++++++++++
2 files changed, 13 insertions(+)
diff --git a/Src/hashtable.c b/Src/hashtable.c
index 6ec2ed220..b7baa3142 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1261,6 +1261,8 @@ printaliasnode(HashNode hn, int printflags)
if (printflags & PRINT_WHENCE_WORD) {
if (a->node.flags & ALIAS_SUFFIX)
printf("%s: suffix alias\n", a->node.nam);
+ else if (a->node.flags & ALIAS_GLOBAL)
+ printf("%s: global alias\n", a->node.nam);
else
printf("%s: alias\n", a->node.nam);
return;
diff --git a/Test/A02alias.ztst b/Test/A02alias.ztst
index e68e93e0d..99f7aae26 100644
--- a/Test/A02alias.ztst
+++ b/Test/A02alias.ztst
@@ -137,3 +137,14 @@
thisworks)
0:NO_ALIAS_FUNC_DEF works if the alias is a complete definition
>That worked
+
+ type \bar
+ type -w \bar
+ type \\bar
+ type -w \\bar
+0:type -w of alias -g
+>bar is a global alias for echo
+>bar: global alias
+>\bar is an alias for echo
+>\bar: alias
+
Messages sorted by:
Reverse Date,
Date,
Thread,
Author