9 #include "packager/app/validate_flag.h"
13 #include "packager/base/strings/stringprintf.h"
15 namespace edash_packager {
18 const std::string& flag_value,
22 if (flag_value.empty()) {
23 if (!optional && condition) {
25 base::StringPrintf(
"--%s is required if %s.", flag_name, label));
28 }
else if (!condition) {
30 "--%s should be specified only if %s.", flag_name, label));
37 fprintf(stderr,
"ERROR: %s\n", error_message.c_str());
bool ValidateFlag(const char *flag_name, const std::string &flag_value, bool condition, bool optional, const char *label)
void PrintError(const std::string &error_message)