cvarreset enhancement
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1256 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
01d13116a4
commit
acf77a47eb
1 changed files with 10 additions and 2 deletions
|
@ -362,12 +362,13 @@ void Cvar_Reset_f (void)
|
||||||
{
|
{
|
||||||
cvar_group_t *grp;
|
cvar_group_t *grp;
|
||||||
cvar_t *cmd;
|
cvar_t *cmd;
|
||||||
int i, listflags;
|
int i, listflags, exclflags;
|
||||||
char *var;
|
char *var;
|
||||||
char *search, *gsearch;
|
char *search, *gsearch;
|
||||||
char strtmp[512];
|
char strtmp[512];
|
||||||
|
|
||||||
search = gsearch = NULL;
|
search = gsearch = NULL;
|
||||||
|
exclflags = 0;
|
||||||
|
|
||||||
// parse command line options
|
// parse command line options
|
||||||
for (i = 1; i < Cmd_Argc(); i++)
|
for (i = 1; i < Cmd_Argc(); i++)
|
||||||
|
@ -394,12 +395,15 @@ void Cvar_Reset_f (void)
|
||||||
|
|
||||||
gsearch = Cmd_Argv(i);
|
gsearch = Cmd_Argv(i);
|
||||||
break;
|
break;
|
||||||
|
case 'u':
|
||||||
|
exclflags |= CVAR_USERCREATED;
|
||||||
case 'h':
|
case 'h':
|
||||||
Con_Printf("cvarreset resets all cvars to default values matching given parameters\n"
|
Con_Printf("cvarreset resets all cvars to default values matching given parameters\n"
|
||||||
"Syntax: cvarreset [-a] (-g group)/cvar\n"
|
"Syntax: cvarreset [-ahu] (-g group)/cvar\n"
|
||||||
" -a matches cvar against alternate cvar names\n"
|
" -a matches cvar against alternate cvar names\n"
|
||||||
" -g matches using wildcards in group\n"
|
" -g matches using wildcards in group\n"
|
||||||
" -h shows this help message\n"
|
" -h shows this help message\n"
|
||||||
|
" -u excludes user cvars\n"
|
||||||
" cvar indicates the cvars to reset, wildcards (*, ?) accepted\n"
|
" cvar indicates the cvars to reset, wildcards (*, ?) accepted\n"
|
||||||
"A -g or cvar is required\n");
|
"A -g or cvar is required\n");
|
||||||
return;
|
return;
|
||||||
|
@ -441,6 +445,10 @@ void Cvar_Reset_f (void)
|
||||||
if ((cmd->restriction?cmd->restriction:rcon_level.value) > Cmd_ExecLevel)
|
if ((cmd->restriction?cmd->restriction:rcon_level.value) > Cmd_ExecLevel)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// don't reset cvars with matched flags
|
||||||
|
if (exclflags & cmd->flags)
|
||||||
|
continue;
|
||||||
|
|
||||||
// reset only cvars with search substring
|
// reset only cvars with search substring
|
||||||
if (search)
|
if (search)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue