From c58a179f871e0221a389019dc2873483e156b3c2 Mon Sep 17 00:00:00 2001
From: Spoike <acceptthis@users.sourceforge.net>
Date: Tue, 21 Dec 2004 04:38:02 +0000
Subject: [PATCH] A showalias command, just like up2 requested.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@671 fc73d0e0-1445-4013-8a0c-d673dee63da5
---
 engine/common/cmd.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/engine/common/cmd.c b/engine/common/cmd.c
index 62f95f661..822b3c3d2 100644
--- a/engine/common/cmd.c
+++ b/engine/common/cmd.c
@@ -537,6 +537,26 @@ char *CopyString (char *in)
 	return out;
 }
 
+void Cmd_ShowAlias_f (void)
+{
+	cmdalias_t	*a;
+	char *s;
+
+	s = Cmd_Argv(1);
+
+	//find it, print it
+	for (a = cmd_alias ; a ; a=a->next)
+	{
+		if (!strcmp(s, a->name))
+		{
+			Con_Printf ("alias %s %s\n", a->name, a->value);
+			return;
+		}
+	}
+
+	Con_Printf("Alias doesn't exist\n");
+}
+
 /*
 ===============
 Cmd_Alias_f
@@ -2616,6 +2636,7 @@ void Cmd_Init (void)
 	Cmd_AddCommand ("restrict", Cmd_RestrictCommand_f);
 	Cmd_AddCommand ("aliaslevel", Cmd_AliasLevel_f);
 #endif
+	Cmd_AddCommand ("showalias", Cmd_ShowAlias_f);
 
 //	Cmd_AddCommand ("msg_trigger", Cmd_Msg_Trigger_f);
 //	Cmd_AddCommand ("filter", Cmd_Msg_Filter_f);