1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-06 07:03:52 +00:00

using -- notation

This commit is contained in:
Henry Fredrick Schreiner 2017-02-09 17:20:44 -05:00
parent aac712b754
commit 38f746db3a
2 changed files with 5 additions and 5 deletions

View File

@ -29,9 +29,9 @@ std::vector<std::string> 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;

View File

@ -19,7 +19,7 @@ TEST(StringBased, First) {
std::vector<std::string> output = CLI::detail::parse_ini(ofile);
std::vector<std::string> answer = {"one=three", "two=four"};
std::vector<std::string> answer = {"--one=three", "--two=four"};
EXPECT_EQ(answer, output);
@ -37,7 +37,7 @@ TEST(StringBased, Sections) {
std::vector<std::string> output = CLI::detail::parse_ini(ofile);
std::vector<std::string> answer = {"one=three", "second.two=four"};
std::vector<std::string> answer = {"--one=three", "--second.two=four"};
EXPECT_EQ(answer, output);
@ -57,7 +57,7 @@ TEST(StringBased, SpacesSections) {
std::vector<std::string> output = CLI::detail::parse_ini(ofile);
std::vector<std::string> answer = {"one=three", "second.two=four"};
std::vector<std::string> answer = {"--one=three", "--second.two=four"};
EXPECT_EQ(answer, output);