mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-06 07:03:52 +00:00
using -- notation
This commit is contained in:
parent
aac712b754
commit
38f746db3a
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user