mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 11:21:12 +08:00
- 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:
parent
feeaa65cdc
commit
ae6ca87221
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user