Add support for filename flags to the flags parser. Allow setting config values

from the command line.
This commit is contained in:
David Given
2021-05-13 23:16:52 +02:00
parent a3bd7cc644
commit c3aa12db78
9 changed files with 98 additions and 39 deletions

View File

@@ -29,11 +29,13 @@ static void test_setting(void)
setProtoByString(&config, "m.s", "string");
setProtoByString(&config, "r.s", "val1");
setProtoByString(&config, "r.s", "val2");
setProtoByString(&config, "firstoption.s", "1");
setProtoByString(&config, "secondoption.s", "2");
std::string s;
google::protobuf::TextFormat::PrintToString(config, &s);
s = cleanup(s);
AssertThat(s, Equals("i64: -1 i32: -2 u64: 3 u32: 4 d: 5.5 m { s: \"string\" } r { s: \"val2\" }"));
AssertThat(s, Equals("i64: -1 i32: -2 u64: 3 u32: 4 d: 5.5 m { s: \"string\" } r { s: \"val2\" } secondoption { s: \"2\" }"));
}
static void test_config(void)