-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142246
-----------------------------------------------------------
3rdparty/stout/include/stout/flags/flags.hpp (lines 905 - 906)
<https://reviews.apache.org/r/50002/#comment207791>
Might want to either remove the comment about command-line flags, or expand it to point
out that the other overloads handle command-line arguments and then forward them to this function.
3rdparty/stout/tests/flags_tests.cpp (line 546)
<https://reviews.apache.org/r/50002/#comment207792>
Another option would be to scope the flag loading/checking so that you can use the same
variable name for each map:
```cpp
{
flags = TestFlags();
std::map<std::string, Option<std::string>> values;
values["name1"] = "billy joel";
values["name2"] = "51";
// load(map<string, Option<string>, unknowns, prefix)
Try<Warnings> load = flags.load(values, false, "FLAGSTEST_");
EXPECT_SOME(load);
EXPECT_EQ(0, load->warnings.size());
EXPECT_EQ(flags.name1, "billy joel");
EXPECT_EQ(flags.name2, 51);
EXPECT_SOME(load);
EXPECT_EQ(0, load->warnings.size());
EXPECT_EQ(flags.name1, "billy joel");
EXPECT_EQ(flags.name2, 51);
}
```
- Greg Mann
On July 13, 2016, 8:53 p.m., Ammar Askar wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50002/
> -----------------------------------------------------------
>
> (Updated July 13, 2016, 8:53 p.m.)
>
>
> Review request for mesos, Greg Mann and Vinod Kone.
>
>
> Bugs: MESOS-5613
> https://issues.apache.org/jira/browse/MESOS-5613
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Allow all flags load methods to specify a prefix.
>
> This also refactors the prefix logic into one place, so that's nice.
> Required for the actual fix for passing work_dir in local.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/flags/flags.hpp dd9362772d1fbd32638fc7e70126fd49d4a03c68
> 3rdparty/stout/tests/flags_tests.cpp 77f3a6af110da1ffcdf2b7ab2b66431a6b5c91d3
>
> Diff: https://reviews.apache.org/r/50002/diff/
>
>
> Testing
> -------
>
> Added additional tests to flags_tests.cpp to ensure that prefix works on the other methods.
>
> `make check` passes
>
>
> Thanks,
>
> Ammar Askar
>
>
|