MCPcopy Create free account
hub / github.com/ZDoom/Raze / C_ParseCmdLineParams

Function C_ParseCmdLineParams

source/common/console/c_dispatch.cpp:862–892  ·  view source on GitHub ↗

Execute any console commands specified on the command line. These all begin with '+' as opposed to '-'.

Source from the content-addressed store, hash-verified

860// Execute any console commands specified on the command line.
861// These all begin with '+' as opposed to '-'.
862FExecList *C_ParseCmdLineParams(FExecList *exec)
863{
864 for (int currArg = 1; currArg < Args->NumArgs(); )
865 {
866 if (*Args->GetArg (currArg++) == '+')
867 {
868 FString cmdString;
869 int cmdlen = 1;
870 int argstart = currArg - 1;
871
872 while (currArg < Args->NumArgs())
873 {
874 if (*Args->GetArg (currArg) == '-' || *Args->GetArg (currArg) == '+')
875 break;
876 currArg++;
877 cmdlen++;
878 }
879
880 cmdString = BuildString (cmdlen, Args->GetArgList (argstart));
881 if (!cmdString.IsEmpty())
882 {
883 if (exec == NULL)
884 {
885 exec = new FExecList;
886 }
887 exec->AddCommand(&cmdString[1]);
888 }
889 }
890 }
891 return exec;
892}
893
894bool FConsoleCommand::IsAlias ()
895{

Callers 1

G_ReadConfigFunction · 0.85

Calls 6

BuildStringFunction · 0.85
NumArgsMethod · 0.80
GetArgListMethod · 0.80
GetArgMethod · 0.45
IsEmptyMethod · 0.45
AddCommandMethod · 0.45

Tested by

no test coverage detected