1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

Better ini config behavour with one quote

This commit is contained in:
Henry Fredrick Schreiner 2017-03-15 08:29:26 -04:00
parent 7b01535303
commit 0ca8a43ebd
3 changed files with 4 additions and 9 deletions

View File

@ -167,7 +167,7 @@ std::vector<std::string> inline split_up(std::string str) {
output.push_back(str.substr(1,end-1));
str = str.substr(end+1);
} else {
output.push_back(str);
output.push_back(str.substr(1));
str = "";
}
} else if(str[0] == '\"') {
@ -176,7 +176,7 @@ std::vector<std::string> inline split_up(std::string str) {
output.push_back(str.substr(1,end-1));
str = str.substr(end+1);
} else {
output.push_back(str);
output.push_back(str.substr(1));
str = "";
}

View File

@ -298,12 +298,12 @@ TEST(SplitUp, Spaces) {
}
TEST(SplitUp, BadStrings) {
std::vector<std::string> oput = {"one", "\" two three"};
std::vector<std::string> oput = {"one", " two three"};
std::string orig {" one \" two three "};
std::vector<std::string> result = CLI::detail::split_up(orig);
EXPECT_EQ(oput, result);
oput = {"one", "\' two three"};
oput = {"one", " two three"};
orig = " one \' two three ";
result = CLI::detail::split_up(orig);
EXPECT_EQ(oput, result);

View File

@ -331,8 +331,3 @@ TEST_F(TApp, IniOutputFlag) {
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
}
TEST_F(TApp, IniSpaces) {
}