launcher/launcher.cpp
static const char *BuildCommand()
{
	static CUtlBuffer build( 0, 0, CUtlBuffer::TEXT_BUFFER );
	build.Clear();

	// arg[0] is the executable name
	for ( int i=1; i < CommandLine()->ParmCount(); i++ )
	{
		const char *szParm = CommandLine()->GetParm(i);
		if (!szParm) continue;

		if (szParm[0] == '-') 
		{
			// skip -XXX options and eat their args
			const char *szValue = CommandLine()->ParmValue(szParm);
			if ( szValue ) i++;
			continue;
		}
		if (szParm[0] == '+')
		{
			// convert +XXX options and stuff them into the build buffer
			const char *szValue = CommandLine()->ParmValue(szParm);
			if (szValue)
			{
				build.PutString(CFmtStr("%s %s;", szParm+1, szValue));
				i++;
			}
			else
			{
				build.PutString(szParm+1);
				build.PutChar(';');
			}
		}
		else 
		{
			// singleton values, convert to command
			char const *translated = Cmd_TranslateFileAssociation( CommandLine()->GetParm( i ) );
			if (translated)
			{
				build.PutString(translated);
				build.PutChar(';');
			}
		}
	}

	build.PutChar( '\0' );

	return (const char *)build.Base();
}
//-----------------------------------------------------------------------------
// Purpose: Converts all the convar args into a convar command
// Input  : none 
// Output : const char * series of convars
//-----------------------------------------------------------------------------
Converts all the convar args into a convar command
Input  : none
Output : const char * series of convars
Converts all the convar args into a convar command Input : none Output : const char * series of convars
static const char *BuildCommand()
{
	static CUtlBuffer build( 0, 0, CUtlBuffer::TEXT_BUFFER );
	build.Clear();
	for ( int i=1; i < CommandLine()->ParmCount(); i++ )
	{
		const char *szParm = CommandLine()->GetParm(i);
		if (!szParm) continue;
		if (szParm[0] == '-') 
		{
			const char *szValue = CommandLine()->ParmValue(szParm);
			if ( szValue ) i++;
			continue;
		}
		if (szParm[0] == '+')
		{
			const char *szValue = CommandLine()->ParmValue(szParm);
			if (szValue)
			{
				build.PutString(CFmtStr("%s %s;", szParm+1, szValue));
				i++;
			}
			else
			{
				build.PutString(szParm+1);
				build.PutChar(';');
			}
		}
		else 
		{
			char const *translated = Cmd_TranslateFileAssociation( CommandLine()->GetParm( i ) );
			if (translated)
			{
				build.PutString(translated);
				build.PutChar(';');
			}
		}
	}
	build.PutChar( '\0' );
	return (const char *)build.Base();
}
static const char * BuildCommand ( ) { static CUtlBuffer build ( 0 , 0 , CUtlBuffer :: TEXT_BUFFER ) ; build . Clear ( ) ; for ( int i = 1 ; i < CommandLine ( ) -> ParmCount ( ) ; i ++ ) { const char * szParm = CommandLine ( ) -> GetParm ( i ) ; if ( ! szParm ) continue ; if ( szParm [ 0 ] == ' ' ) { const char * szValue = CommandLine ( ) -> ParmValue ( szParm ) ; if ( szValue ) i ++ ; continue ; } if ( szParm [ 0 ] == ' ' ) { const char * szValue = CommandLine ( ) -> ParmValue ( szParm ) ; if ( szValue ) { build . PutString ( CFmtStr ( " " , szParm + 1 , szValue ) ) ; i ++ ; } else { build . PutString ( szParm + 1 ) ; build . PutChar ( ' ' ) ; } } else { char const * translated = Cmd_TranslateFileAssociation ( CommandLine ( ) -> GetParm ( i ) ) ; if ( translated ) { build . PutString ( translated ) ; build . PutChar ( ' ' ) ; } } } build . PutChar ( ' \0 ' ) ; return ( const char * ) build . Base ( ) ; }
Purpose: Converts all the convar args into a convar command
Input  : none
Output : const char * series of convars
Purpose : Converts all the convar args into a convar command Input : none Output : const char * series of convars
// arg[0] is the executable name // skip -XXX options and eat their args // convert +XXX options and stuff them into the build buffer // singleton values, convert to command