-
Notifications
You must be signed in to change notification settings - Fork 446
Open
Labels
Description
Usage Information
9.0.3 / 8.0.11 / net8 / Windows 11
Description
If you declare a tool that takes a directory as its only argument and that directory contains spaces, ArgumentStringHandler will not quote the path.
Reproduction Steps
Add this test to ArgumentStringHandlerTest:
[Fact]
public void TestSpacedPathOnly()
{
ArgsToString($"{"C:/Program Files"}").Should().Be("\"C:/Program Files\"");
}
Expected Behavior
string path = "C:/Program Files";
MyTool($"{path}");
should call:
path_to_tool/MyTool.exe "C:/Program Files"
Actual Behavior
no quotes:
path_to_tool/MyTool.exe C:/Program Files
Regression?
7.0.2 on net6 did not do this
Known Workarounds
Adding a space at the end seems to help:
MyTool($"{path} ");
Could you help with a pull-request?
Yes