Commit 9ef0d522 authored by Andreas Schuh's avatar Andreas Schuh

enh: Add usage of DEFINE_validator to test project

parent 02f31897
......@@ -3,9 +3,16 @@
DEFINE_string(message, "Hello World!", "The message to print");
static bool ValidateMessage(const char* flagname, const std::string &message)
{
return !message.empty();
}
DEFINE_validator(message, ValidateMessage);
int main(int argc, char **argv)
{
gflags::SetUsageMessage("Test CMake configuration of gflags library (gflags-config.cmake)");
gflags::SetVersionString("0.1");
gflags::ParseCommandLineFlags(&argc, &argv, true);
std::cout << FLAGS_message << std::endl;
gflags::ShutDownCommandLineFlags();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment