[quake3-commits] r2258 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jun 18 12:09:14 EDT 2012


Author: ztm
Date: 2012-06-18 12:09:14 -0400 (Mon, 18 Jun 2012)
New Revision: 2258

Modified:
   trunk/code/qcommon/cmd.c
Log:
add the "execq" command, a more quiet version of the "exec" command
in exec/execq, always print the extension for the filename

>From /dev/humancontroller.

Modified: trunk/code/qcommon/cmd.c
===================================================================
--- trunk/code/qcommon/cmd.c	2012-06-18 16:05:47 UTC (rev 2257)
+++ trunk/code/qcommon/cmd.c	2012-06-18 16:09:14 UTC (rev 2258)
@@ -265,14 +265,18 @@
 ===============
 */
 void Cmd_Exec_f( void ) {
+	qboolean quiet;
 	union {
 		char	*c;
 		void	*v;
 	} f;
 	char	filename[MAX_QPATH];
 
+	quiet = !Q_stricmp(Cmd_Argv(0), "execq");
+
 	if (Cmd_Argc () != 2) {
-		Com_Printf ("exec <filename> : execute a script file\n");
+		Com_Printf ("exec%s <filename> : execute a script file%s\n",
+		            quiet ? "q" : "", quiet ? " without notification" : "");
 		return;
 	}
 
@@ -280,10 +284,11 @@
 	COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
 	FS_ReadFile( filename, &f.v);
 	if (!f.c) {
-		Com_Printf ("couldn't exec %s\n",Cmd_Argv(1));
+		Com_Printf ("couldn't exec %s\n", filename);
 		return;
 	}
-	Com_Printf ("execing %s\n",Cmd_Argv(1));
+	if (!quiet)
+		Com_Printf ("execing %s\n", filename);
 	
 	Cbuf_InsertText (f.c);
 
@@ -853,7 +858,9 @@
 void Cmd_Init (void) {
 	Cmd_AddCommand ("cmdlist",Cmd_List_f);
 	Cmd_AddCommand ("exec",Cmd_Exec_f);
+	Cmd_AddCommand ("execq",Cmd_Exec_f);
 	Cmd_SetCommandCompletionFunc( "exec", Cmd_CompleteCfgName );
+	Cmd_SetCommandCompletionFunc( "execq", Cmd_CompleteCfgName );
 	Cmd_AddCommand ("vstr",Cmd_Vstr_f);
 	Cmd_SetCommandCompletionFunc( "vstr", Cvar_CompleteCvarName );
 	Cmd_AddCommand ("echo",Cmd_Echo_f);



More information about the quake3-commits mailing list