if (!matchpattern_with_separator(cvar->name, partial, true, "", false))
if (!matchpattern_with_separator(cvar->description, partial, true, "", false))
continue;
- Con_Printf ("cvar ^3%s^7 is \"%s\" [\"%s\"] %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description);
+ Con_Printf ("cvar ");
+ Cvar_PrintHelp(cvar, true);
count++;
}
for (func = cmd->userdefined->csqc_functions; func; func = func->next)
return buf;
}
+void Cvar_PrintHelp(cvar_t *cvar, qboolean full)
+{
+ Con_Printf("^3%s^7 is \"%s\" [\"%s\"] ", cvar->name, ((cvar->flags & CVAR_PRIVATE) ? "********"/*hunter2*/ : cvar->string), cvar->defstring);
+ if (full)
+ Con_Printf("%s", cvar->description);
+ Con_Printf("\n");
+}
+
// written by LadyHavoc
void Cvar_CompleteCvarPrint(cvar_state_t *cvars, const char *partial, int neededflags)
{
// Loop through the command list and print all matches
for (cvar = cvars->vars; cvar; cvar = cvar->next)
if (!strncasecmp(partial, cvar->name, len) && (cvar->flags & neededflags))
- Con_Printf ("^3%s^7 is \"%s\" [\"%s\"] %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description);
+ Cvar_PrintHelp(cvar, true);
}
// check if a cvar is held by some progs
// perform a variable print or set
if (Cmd_Argc(cmd) == 1)
{
- Con_Printf("\"%s\" is \"%s\" [\"%s\"]\n", v->name, ((v->flags & CVAR_PRIVATE) ? "********"/*hunter2*/ : v->string), v->defstring);
+ Cvar_PrintHelp(v, true);
return true;
}
if (len && (ispattern ? !matchpattern_with_separator(cvar->name, partial, false, "", false) : strncmp (partial,cvar->name,len)))
continue;
- Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, ((cvar->flags & CVAR_PRIVATE) ? "********"/*hunter2*/ : cvar->string), cvar->defstring, cvar->description);
+ Cvar_PrintHelp(cvar, true);
count++;
}
// attempts to match a partial variable name for command line completion
// returns NULL if nothing fits
+void Cvar_PrintHelp(cvar_t *cvar, qboolean full);
+
void Cvar_CompleteCvarPrint (cvar_state_t *cvars, const char *partial, int neededflags);
qboolean Cvar_Command (cmd_state_t *cmd);