MCPcopy Create free account
hub / github.com/DarthTon/Xenos / ParseCmdLine

Function ParseCmdLine

src/Main.cpp:88–109  ·  view source on GitHub ↗

Parse command line string Resulting param Profile action

Source from the content-addressed store, hash-verified

86/// <param name="param">Resulting param</param>
87/// <returns>Profile action</returns>
88MainDlg::StartAction ParseCmdLine( std::wstring& param )
89{
90 int argc = 0;
91 auto pCmdLine = GetCommandLineW();
92 auto argv = CommandLineToArgvW( pCmdLine, &argc );
93
94 for (int i = 1; i < argc; i++)
95 {
96 if (_wcsicmp( argv[i], L"--load" ) == 0 && i + 1 < argc)
97 {
98 param = argv[i + 1];
99 return MainDlg::LoadProfile;
100 }
101 if (_wcsicmp( argv[i], L"--run" ) == 0 && i + 1 < argc)
102 {
103 param = argv[i + 1];
104 return MainDlg::RunProfile;
105 }
106 }
107
108 return MainDlg::Nothing;
109}
110
111int APIENTRY wWinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/ )
112{

Callers 1

wWinMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected