It's possible to set a user-created cvar with the same name as a client command. E.g.
]/set reset "echo Cancelled; bind HOME vstr fullscreen; bind END vstr windowed"
The content of the cvar, normally referenced through /cvarname in the console, now cannot be read:
]/reset
usage: reset <variable>
Reserving some names is not an option for two reasons: one, it restricts the user unnecessarily, and two, it does not account for possible server-added commands, etc.
A much better solution would be to create a new command (or use /set with no value argument) that printed the contents of the given cvar.
Created attachment 1677[details]
cvar.c refactoring
It occurred to me that I still hadn't submitted a bug report for this patch, which simplifies code/qcommon/cvar.c and coincidentally fixes the issue I described (/set cvar now prints the relevant value).
If the other parts of this bug are too much, I'll separate out the relevant parts tomorrow sometime.
The patch seems reasonably clean, and your command for reading cvars is useful and probably more intuitive than just calling /set without arguments. I renamed the "read" command to "print" though, as this is what the command is actually doing.
Created attachment 1677 [details] cvar.c refactoring It occurred to me that I still hadn't submitted a bug report for this patch, which simplifies code/qcommon/cvar.c and coincidentally fixes the issue I described (/set cvar now prints the relevant value). If the other parts of this bug are too much, I'll separate out the relevant parts tomorrow sometime.
Created attachment 1700 [details] Cmd_Read_f Creates a command /read cvar to print its contents.