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);
36 template <
class FlagType>
38 const FlagType& flag_value,
42 if (flag_value.empty()) {
43 if (!optional && condition) {
45 base::StringPrintf(
"--%s is required if %s.", flag_name, label));
48 }
else if (!condition) {
50 "--%s should be specified only if %s.", flag_name, label));
All the methods that are virtual are virtual for mocking.
void PrintWarning(const std::string &warning_message)
void PrintError(const std::string &error_message)
bool ValidateFlag(const char *flag_name, const FlagType &flag_value, bool condition, bool optional, const char *label)