From 38f746db3a7494c13d151f2f5c7ed17159293f83 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Thu, 9 Feb 2017 17:20:44 -0500 Subject: [PATCH] using -- notation --- include/CLI/Ini.hpp | 4 ++-- tests/INITest.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/CLI/Ini.hpp b/include/CLI/Ini.hpp index a346691b..756e971c 100644 --- a/include/CLI/Ini.hpp +++ b/include/CLI/Ini.hpp @@ -29,9 +29,9 @@ std::vector parse_ini(std::istream &input) { std::transform(std::begin(section), std::end(section), std::begin(section), ::tolower); } else if (len > 0) { if(section == "default") - output.push_back(line); + output.push_back("--" + line); else - output.push_back(section + "." + line); + output.push_back("--" + section + "." + line); } } return output; diff --git a/tests/INITest.cpp b/tests/INITest.cpp index d3410ee0..1805845c 100644 --- a/tests/INITest.cpp +++ b/tests/INITest.cpp @@ -19,7 +19,7 @@ TEST(StringBased, First) { std::vector output = CLI::detail::parse_ini(ofile); - std::vector answer = {"one=three", "two=four"}; + std::vector answer = {"--one=three", "--two=four"}; EXPECT_EQ(answer, output); @@ -37,7 +37,7 @@ TEST(StringBased, Sections) { std::vector output = CLI::detail::parse_ini(ofile); - std::vector answer = {"one=three", "second.two=four"}; + std::vector answer = {"--one=three", "--second.two=four"}; EXPECT_EQ(answer, output); @@ -57,7 +57,7 @@ TEST(StringBased, SpacesSections) { std::vector output = CLI::detail::parse_ini(ofile); - std::vector answer = {"one=three", "second.two=four"}; + std::vector answer = {"--one=three", "--second.two=four"}; EXPECT_EQ(answer, output);