dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
705 stars 1.55k forks source link

ProcessStartInfo.Arguments Incomplete Parsing Rules #10427

Open brinko99 opened 2 hours ago

brinko99 commented 2 hours ago

Type of issue

Missing information

Description

The formatting of command line arguments when populating ProcessStartInfo.Arguments is extremely complicated. The current documentation does not describe the full set of parsing rules.

The documentation for Environment.GetCommandLineArgs does describe the rules more fully (though, still confusingly). I recommend duplicating the description of parsing rules from Environment.GetCommandLineArgs on the documentation page for ProcessStartInfo.Arguments or, at the very least, linking to them.

For examples of the confusion the parsing rules cause, see: https://stackoverflow.com/questions/5510343/escape-command-line-arguments-in-c-sharp https://stackoverflow.com/questions/15365038/how-processstartinfo-argument-consider-arguments

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.arguments?view=net-8.0&devlangs=csharp&f1url=%3FappId%3DDev17IDEF1%26l%3DEN-US%26k%3Dk(System.Diagnostics.ProcessStartInfo.Arguments)%3Bk(DevLang-csharp)%26rd%3Dtrue

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Diagnostics/ProcessStartInfo.xml

Document Version Independent Id

a5723e00-a422-7766-5f8e-d7d4986add0a

Article author

@dotnet-bot

dotnet-policy-service[bot] commented 2 hours ago

Tagging subscribers to this area: @tommcdon