Lines Matching refs:arg
76 static void PrintError(const std::string& arg, std::string msg, bool from_env) { in PrintError() argument
78 std::string variable(arg); in PrintError()
82 } else if (arg[0] == '-') { in PrintError()
83 printf("%s %s\n", arg.c_str(), msg.c_str()); in PrintError()
85 printf("--%s %s\n", arg.c_str(), msg.c_str()); in PrintError()
90 static bool GetNumeric(const char* arg, const char* value, IntType* numeric_value, bool from_env) { in GetNumeric() argument
99 PrintError(arg, std::string("value overflows (") + value + ")", from_env); in GetNumeric()
101 PrintError(arg, std::string("value is not formatted as a numeric value (") + value + ")", in GetNumeric()
116 bool Options::SetNumeric(const std::string& arg, const std::string& value, bool from_env) { in SetNumeric() argument
117 uint64_t* numeric = &numerics_.find(arg)->second; in SetNumeric()
118 if (!GetNumeric<uint64_t>(arg.c_str(), value.c_str(), numeric, from_env)) { in SetNumeric()
122 PrintError(arg, "requires a number greater than zero.", from_env); in SetNumeric()
128 bool Options::SetNumericEnvOnly(const std::string& arg, const std::string& value, bool from_env) { in SetNumericEnvOnly() argument
130 PrintError(arg, "is only supported as an environment variable.", false); in SetNumericEnvOnly()
133 uint64_t* numeric = &numerics_.find(arg)->second; in SetNumericEnvOnly()
134 if (!GetNumeric<uint64_t>(arg.c_str(), value.c_str(), numeric, from_env)) { in SetNumericEnvOnly()
140 bool Options::SetBool(const std::string& arg, const std::string&, bool) { in SetBool() argument
141 bools_.find(arg)->second = true; in SetBool()
145 bool Options::SetIterations(const std::string& arg, const std::string& value, bool from_env) { in SetIterations() argument
146 if (!GetNumeric<int>(arg.c_str(), value.c_str(), &num_iterations_, from_env)) { in SetIterations()
152 bool Options::SetString(const std::string& arg, const std::string& value, bool) { in SetString() argument
153 strings_.find(arg)->second = value; in SetString()
157 bool Options::SetXmlFile(const std::string& arg, const std::string& value, bool from_env) { in SetXmlFile() argument
159 PrintError(arg, "only supports an xml output file.", from_env); in SetXmlFile()
164 PrintError(arg, "requires a file name after xml:", from_env); in SetXmlFile()
171 PrintError(arg, in SetXmlFile()
189 bool Options::HandleArg(const std::string& arg, const std::string& value, const ArgInfo& info, in HandleArg() argument
192 PrintError(arg, "is not compatible with isolation runs.", from_env); in HandleArg()
198 PrintError(arg, "requires an argument.", from_env); in HandleArg()
202 if (info.func != nullptr && !(this->*(info.func))(arg, value, from_env)) { in HandleArg()
206 PrintError(arg, "does not take an argument.", from_env); in HandleArg()
209 return (this->*(info.func))(arg, value, from_env); in HandleArg()