Commit 38f746db3a7494c13d151f2f5c7ed17159293f83

Authored by Henry Fredrick Schreiner
1 parent aac712b7

using -- notation

include/CLI/Ini.hpp
... ... @@ -29,9 +29,9 @@ std::vector<std::string> parse_ini(std::istream &input) {
29 29 std::transform(std::begin(section), std::end(section), std::begin(section), ::tolower);
30 30 } else if (len > 0) {
31 31 if(section == "default")
32   - output.push_back(line);
  32 + output.push_back("--" + line);
33 33 else
34   - output.push_back(section + "." + line);
  34 + output.push_back("--" + section + "." + line);
35 35 }
36 36 }
37 37 return output;
... ...
tests/INITest.cpp
... ... @@ -19,7 +19,7 @@ TEST(StringBased, First) {
19 19  
20 20 std::vector<std::string> output = CLI::detail::parse_ini(ofile);
21 21  
22   - std::vector<std::string> answer = {"one=three", "two=four"};
  22 + std::vector<std::string> answer = {"--one=three", "--two=four"};
23 23  
24 24 EXPECT_EQ(answer, output);
25 25  
... ... @@ -37,7 +37,7 @@ TEST(StringBased, Sections) {
37 37  
38 38 std::vector<std::string> output = CLI::detail::parse_ini(ofile);
39 39  
40   - std::vector<std::string> answer = {"one=three", "second.two=four"};
  40 + std::vector<std::string> answer = {"--one=three", "--second.two=four"};
41 41  
42 42 EXPECT_EQ(answer, output);
43 43  
... ... @@ -57,7 +57,7 @@ TEST(StringBased, SpacesSections) {
57 57  
58 58 std::vector<std::string> output = CLI::detail::parse_ini(ofile);
59 59  
60   - std::vector<std::string> answer = {"one=three", "second.two=four"};
  60 + std::vector<std::string> answer = {"--one=three", "--second.two=four"};
61 61  
62 62 EXPECT_EQ(answer, output);
63 63  
... ...