9 #include "packager/app/validate_flag.h"
13 #include "packager/base/strings/stringprintf.h"
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());
void PrintError(const std::string &error_message)
bool ValidateFlag(const char *flag_name, const std::string &flag_value, bool condition, bool optional, const char *label)