cmdlist now accepts wildcards. qqshaka was the first to notice it previously sucked.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6195 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2022-02-19 20:49:49 +00:00
parent 01c498d136
commit 1f707225e3

View file

@ -2622,10 +2622,16 @@ static void Cmd_List_f (void)
{ {
cmd_function_t *cmd; cmd_function_t *cmd;
int num=0; int num=0;
const char *search = (Cmd_Argc()>1)?Cmd_Argv(1):NULL;
for (cmd=cmd_functions ; cmd ; cmd=cmd->next) for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
{ {
if ((cmd->restriction?cmd->restriction:rcon_level.ival) > Cmd_ExecLevel) if ((cmd->restriction?cmd->restriction:rcon_level.ival) > Cmd_ExecLevel)
continue; continue;
if (search)
if (!wildcmp(search, cmd->name))
continue; //nope, no match
if (!num) if (!num)
Con_TPrintf("Command list:\n"); Con_TPrintf("Command list:\n");
Con_Printf("(%2i) %s\n", (int)(cmd->restriction?cmd->restriction:rcon_level.ival), cmd->name); Con_Printf("(%2i) %s\n", (int)(cmd->restriction?cmd->restriction:rcon_level.ival), cmd->name);