MCPcopy Create free account
hub / github.com/beefytech/Beef / HandleCmdLine

Method HandleCmdLine

BeefBoot/BootApp.cpp:238–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238bool BootApp::HandleCmdLine(const String &cmd, const String& param)
239{
240 mHadCmdLine = true;
241
242 bool wantedParam = false;
243
244 if ((!cmd.StartsWith("-")) && (mIsCERun) && (mCESrc.IsEmpty()))
245 {
246 mCESrc = cmd;
247 return true;
248 }
249
250 if ((cmd == "-help") || (cmd == "-h") || (cmd == "/?"))
251 {
252 mShowedHelp = true;
253 std::cout << "BeefBoot - Beef bootstrapping tool" << std::endl;
254
255 return false;
256 }
257 else if (cmd == "-src")
258 {
259 mRequestedSrc.Add(param);
260 wantedParam = true;
261 }
262 else if (cmd == "-verbosity")
263 {
264 if (param == "quiet")
265 mVerbosity = Verbosity_Quiet;
266 else if (param == "minimal")
267 mVerbosity = Verbosity_Minimal;
268 else if (param == "normal")
269 mVerbosity = Verbosity_Normal;
270 else if (param == "detailed")
271 mVerbosity = Verbosity_Detailed;
272 else if (param == "diagnostic")
273 mVerbosity = Verbosity_Diagnostic;
274 else
275 {
276 Fail(StrFormat("Invalid verbosity level: '%s'", param.c_str()));
277 return false;
278 }
279 wantedParam = true;
280 }
281 else if (cmd == "-version")
282 {
283 BfpSystemResult sysResult;
284 String exePath;
285 BFP_GETSTR_HELPER(exePath, sysResult, BfpSystem_GetExecutablePath(__STR, __STRLEN, &sysResult));
286
287 std::cout << "0.0.0" << std::endl;
288 mShowedHelp = true;
289 return true;
290 }
291 else if (cmd == "-define")
292 {
293 if (!mDefines.IsEmpty())
294 mDefines += "\n";
295 mDefines += param;

Callers 1

mainFunction · 0.80

Calls 7

FailFunction · 0.85
StartsWithMethod · 0.45
IsEmptyMethod · 0.45
AddMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected