Lines Matching refs:args
393 bool GetIntFromArg(std::vector<std::string> &args, int &value) in GetIntFromArg() argument
395 if (!args.empty()) { in GetIntFromArg()
396 if (std::all_of(args.begin()->begin(), args.begin()->end(), ::isdigit)) { in GetIntFromArg()
397 value = std::stoi(args[0]); in GetIntFromArg()
398 args.erase(args.begin()); in GetIntFromArg()
400 printf("unknown format '%s'\n", args[0].c_str()); in GetIntFromArg()
407 bool MatchArgs(std::vector<std::string> &args, const std::string &option) in MatchArgs() argument
409 if (args[0] == option) { in MatchArgs()
410 args.erase(args.begin()); in MatchArgs()
415 bool GetBoolFromArg(std::vector<std::string> &args, const std::string &option, bool &value) in GetBoolFromArg() argument
417 if (MatchArgs(args, option)) { in GetBoolFromArg()
428 std::vector<std::string> args; in main() local
430 args.push_back(argv[i]); in main()
434 while (!args.empty()) { in main()
435 if (MatchArgs(args, "--help")) { in main()
438 } else if (MatchArgs(args, "--boundcpu")) { in main()
439 if (!GetIntFromArg(args, option.boundCpu)) { in main()
442 } else if (MatchArgs(args, "--sleep")) { in main()
443 if (!GetIntFromArg(args, option.sleepms)) { in main()
446 } else if (MatchArgs(args, "--thread")) { in main()
447 if (!GetIntFromArg(args, option.numThreads)) { in main()
450 } else if (MatchArgs(args, "--time")) { in main()
451 if (!GetIntFromArg(args, option.second)) { in main()
454 } else if (MatchArgs(args, "--stack")) { in main()
455 if (!GetIntFromArg(args, option.stack)) { in main()
458 } else if (GetBoolFromArg(args, "--dynamic", option.dynamicStack)) { in main()
460 } else if (GetBoolFromArg(args, "--nowait", option.noWait)) { in main()
462 } else if (GetBoolFromArg(args, "--mmap", option.mmap)) { in main()
464 } else if (GetBoolFromArg(args, "--iowait", option.iowait)) { in main()
466 } else if (GetBoolFromArg(args, "--branch", option.branch)) { in main()
468 } else if (GetBoolFromArg(args, "--nonew", option.nonew)) { in main()
470 } else if (GetBoolFromArg(args, "--nofunc", option.nofunc)) { in main()
473 printf("unknown format '%s'\n", args[0].c_str()); in main()