remove trailing \r when parsing response file that might have Windows line endings;
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.
MODIFY
src/vcpkg/base/files.cpp
src/vcpkg/base/files.cpp
@@ -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();

MODIFY
src/vcpkg/vcpkgcmdarguments.cpp
src/vcpkg/vcpkgcmdarguments.cpp
@@ -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;

- 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.