Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-08-10 Thread Ammar Askar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/
---

(Updated Aug. 10, 2016, 11:24 p.m.)


Review request for mesos, Greg Mann and Vinod Kone.


Changes
---

Rebased


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 (updated)
-

  3rdparty/stout/include/stout/flags/flags.hpp dd93627 
  3rdparty/stout/tests/flags_tests.cpp 848d707 

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



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-08-05 Thread Ammar Askar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/
---

(Updated Aug. 5, 2016, 11:58 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 (updated)
-

  3rdparty/stout/include/stout/flags/flags.hpp dd93627 
  3rdparty/stout/tests/flags_tests.cpp 77f3a6a 

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



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-08-05 Thread Vinod Kone

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review145009
---


Fix it, then Ship it!





3rdparty/stout/include/stout/flags/flags.hpp (line 92)


s/aslo/also/


- Vinod Kone


On July 15, 2016, 4:45 p.m., Ammar Askar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50002/
> ---
> 
> (Updated July 15, 2016, 4:45 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 dd93627 
>   3rdparty/stout/tests/flags_tests.cpp 77f3a6a 
> 
> 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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-19 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142901
---


Ship it!




Ship It!

- Greg Mann


On July 15, 2016, 4:45 p.m., Ammar Askar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50002/
> ---
> 
> (Updated July 15, 2016, 4:45 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 dd93627 
>   3rdparty/stout/tests/flags_tests.cpp 77f3a6a 
> 
> 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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-15 Thread Ammar Askar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/
---

(Updated July 15, 2016, 4:45 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 (updated)
-

  3rdparty/stout/include/stout/flags/flags.hpp dd93627 
  3rdparty/stout/tests/flags_tests.cpp 77f3a6a 

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



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-15 Thread Greg Mann

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142385
---



Looks good - just some style stuff below.


3rdparty/stout/include/stout/flags/flags.hpp (line 86)


s/Load/Loads/

Since we inherit from the Google style guide, function comments should be 
descriptive rather than imperative: 
https://google.github.io/styleguide/cppguide.html#Function_Comments



3rdparty/stout/include/stout/flags/flags.hpp (line 92)


s/prefix/`prefix`/

Suggestion:
s/first/also/



3rdparty/stout/include/stout/flags/flags.hpp (line 94)


Suggestion:

s/exists in the/exists in both the/



3rdparty/stout/include/stout/flags/flags.hpp (line 103)


Missing a backtick



3rdparty/stout/include/stout/flags/flags.hpp (line 922)


s/in to/into/



3rdparty/stout/tests/flags_tests.cpp (line 533)


I think this comment could be omitted.


- Greg Mann


On July 14, 2016, 10:10 p.m., Ammar Askar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50002/
> ---
> 
> (Updated July 14, 2016, 10:10 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 dd93627 
>   3rdparty/stout/tests/flags_tests.cpp 77f3a6a 
> 
> 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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-14 Thread Ammar Askar


> On July 14, 2016, 1:27 a.m., Vinod Kone wrote:
> > 3rdparty/stout/tests/flags_tests.cpp, line 546
> > 
> >
> > s/test_option_map/values2/

Scoped so they can share the same name of `values`


- Ammar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142181
---


On July 14, 2016, 10:10 p.m., Ammar Askar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50002/
> ---
> 
> (Updated July 14, 2016, 10:10 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 dd93627 
>   3rdparty/stout/tests/flags_tests.cpp 77f3a6a 
> 
> 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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-14 Thread Ammar Askar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/
---

(Updated July 14, 2016, 10:10 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 (updated)
-

  3rdparty/stout/include/stout/flags/flags.hpp dd93627 
  3rdparty/stout/tests/flags_tests.cpp 77f3a6a 

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



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-14 Thread Ammar Askar


> On July 14, 2016, 4:44 p.m., Greg Mann wrote:
> > 3rdparty/stout/tests/flags_tests.cpp, line 546
> > 
> >
> > 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 values;
> >   values["name1"] = "billy joel";
> >   values["name2"] = "51";
> > 
> >   // load(map >   Try 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);
> > }
> > ```

This sounds good, it also helps seperate which method is being tested than 
whitespace.


- Ammar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142246
---


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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-14 Thread Greg Mann

---
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)


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)


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 values;
  values["name1"] = "billy joel";
  values["name2"] = "51";

  // load(mapwarnings.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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-13 Thread Vinod Kone

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142181
---




3rdparty/stout/tests/flags_tests.cpp (line 534)


s/test_map/values/



3rdparty/stout/tests/flags_tests.cpp (line 546)


s/test_option_map/values2/


- Vinod Kone


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
> 
>



Re: Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-13 Thread Vinod Kone

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/#review142178
---




3rdparty/stout/include/stout/flags/flags.hpp (lines 85 - 94)


Mind adding comments to these functions saying they also load from 
environment?



3rdparty/stout/include/stout/flags/flags.hpp (line 871)


put this back on the previous line.



3rdparty/stout/tests/flags_tests.cpp (line 524)


back ticks around function signatures.
period at the end.

```
`load(prefix, argc, argv)`.
```



3rdparty/stout/tests/flags_tests.cpp (line 537)


see above.



3rdparty/stout/tests/flags_tests.cpp (line 550)


see above.


- Vinod Kone


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
> 
>



Review Request 50002: Allow all flags load methods to specify a prefix.

2016-07-13 Thread Ammar Askar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50002/
---

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