- remove trailing \r when parsing response file that might have Windows line endings; (#7491)

- when an option is not recognized (perhaps because it has trailing whitespace characters), print it out enclosed with single quote to delimit and highlight potenatial not printable characters.
This commit is contained in:
lukka 2019-08-01 17:48:22 -07:00 committed by Phil Christensen
parent feeaa65cdc
commit ae6ca87221
2 changed files with 5 additions and 1 deletions

View File

@ -202,6 +202,10 @@ namespace vcpkg::Files
std::string line;
while (std::getline(file_stream, line))
{
// Remove the trailing \r to accomodate Windows line endings.
if ((!line.empty()) && (line.back() == '\r'))
line.pop_back();
output.push_back(line);
}
file_stream.close();

View File

@ -389,7 +389,7 @@ namespace vcpkg
System::printf(System::Color::error, "Unknown option(s) for command '%s':\n", this->command);
for (auto&& option : options_copy)
{
System::print2(" ", option.first, "\n");
System::print2(" '", option.first, "'\n");
}
System::print2("\n");
failed = true;