mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
aliasing to just a command can now be used as a shortcut.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@76 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f121e3edd7
commit
8698617965
1 changed files with 15 additions and 2 deletions
|
@ -1690,6 +1690,17 @@ void Cmd_ExecuteString (char *text, int level)
|
|||
level = a->execlevel;
|
||||
|
||||
Cbuf_InsertText ("\n", level);
|
||||
|
||||
// if the alias value is a command or cvar and
|
||||
// the alias is called with parameters, add them
|
||||
if (Cmd_Argc() > 1 && !strchr(a->value, ' ') && !strchr(a->value, '\t') &&
|
||||
(Cvar_FindVar(a->value) || (Cmd_Exists(a->value) && a->value[0] != '+' && a->value[0] != '-'))
|
||||
)
|
||||
{
|
||||
Cbuf_InsertText (Cmd_Args(), level);
|
||||
Cbuf_InsertText (" ", level);
|
||||
}
|
||||
|
||||
Cbuf_InsertText (a->value, level);
|
||||
|
||||
Cbuf_InsertText (va("set cmd_argc \"%i\"\n", cmd_argc), level);
|
||||
|
@ -2614,11 +2625,15 @@ Cmd_Init
|
|||
*/
|
||||
void Cmd_Init (void)
|
||||
{
|
||||
extern cvar_t cfg_save_name;
|
||||
//
|
||||
// register our commands
|
||||
//
|
||||
Cmd_AddCommand ("stuffcmds",Cmd_StuffCmds_f);
|
||||
Cmd_AddCommand ("cfg_save",Cmd_WriteConfig_f);
|
||||
Cmd_AddCommand ("cfg_load",Cmd_Exec_f);
|
||||
Cvar_Register (&cfg_save_name, "Configs");
|
||||
|
||||
Cmd_AddCommand ("exec",Cmd_Exec_f);
|
||||
Cmd_AddCommand ("echo",Cmd_Echo_f);
|
||||
Cmd_AddCommand ("alias",Cmd_Alias_f);
|
||||
|
@ -2633,8 +2648,6 @@ void Cmd_Init (void)
|
|||
Cmd_AddCommand ("msg_trigger", Cmd_Msg_Trigger_f);
|
||||
Cmd_AddCommand ("filter", Cmd_Msg_Filter_f);
|
||||
|
||||
Cmd_AddCommand ("cfg_save",Cmd_WriteConfig_f);
|
||||
|
||||
|
||||
Cmd_AddCommand ("set", Cmd_set_f);
|
||||
Cmd_AddCommand ("seta", Cmd_set_f);
|
||||
|
|
Loading…
Reference in a new issue