This article's documentation is for anything that uses the Source engine. Click here for more information.

commandline.cfg

From Valve Developer Community
Jump to navigation Jump to search

English (en)Translate (Translate)

commandline.cfg is a KeyValues configuration file used by Source map compilers (VBSP, VVIS and VRAD) to inject additional command-line arguments during the build process. Introduced in all compiler versions since Source 2006.

The file is read from the game directory folders and the cfg/commandline.cfg path before the compilation process begins.

File Example

"CommandLine"
{
	"map_name_1" // map name without file format
	{
		"vbsp"	"-onlyents -glview"
		"vvis"	"-fast"
		"vrad"	"-staticproplighting -textureshadows"
	}
	
	"map_name_2"
	{
		"vrad"	"-both -final"
	}
}

Impact on the compiling process

If any compiler finds its own additional compilation arguments for this map, the console will display the line Command Line found: <arguments from file>. These parameters will be added to the end of the compiler command line (except for the map file), so this:

vbsp.exe -verbose mymap.vmf

will turn into this:

vbsp.exe -verbose -onlyents -glview mymap.vmf

Implementation in Code

The logic is handled by the LoadCmdLineFromFile function, located in public/loadcmdline.cpp.

The function and its header public/loadcmdline.h are used in the following places: