9 #ifndef APP_VALIDATE_FLAG_H_
10 #define APP_VALIDATE_FLAG_H_
14 #include "packager/base/strings/stringprintf.h"
20 void PrintError(
const std::string& error_message);
32 template <
class FlagType>
34 const FlagType& flag_value,
38 if (flag_value.empty()) {
39 if (!optional && condition) {
41 base::StringPrintf(
"--%s is required if %s.", flag_name, label));
44 }
else if (!condition) {
46 "--%s should be specified only if %s.", flag_name, label));
54 #endif // APP_VALIDATE_FLAG_H_
void PrintError(const std::string &error_message)
bool ValidateFlag(const char *flag_name, const FlagType &flag_value, bool condition, bool optional, const char *label)