Summary
Expose a way to parse MSBuild command-line arguments without throwing when the input includes switches that MSBuild does not recognize. The parser should return the unrecognized arguments (or otherwise make them available to the caller) along with the parsed MSBuild switches.
Microsoft.Build.CommandLine.Experimental.CommandLineParser.Parse(IEnumerable<string>) currently ends in CommandLineSwitches.ThrowErrors(), so an unknown switch raises UnknownSwitchError. Callers that need to distinguish MSBuild options from arguments intended for another process cannot use it for classification, because those non-MSBuild arguments are expected input rather than errors.
This is needed by the .NET SDK as it evaluates using MSBuild's parser to replace hand-maintained switch allowlists; see dotnet/sdk#56123. The parser was extracted for reuse in dotnet/msbuild#12836.
Summary
Expose a way to parse MSBuild command-line arguments without throwing when the input includes switches that MSBuild does not recognize. The parser should return the unrecognized arguments (or otherwise make them available to the caller) along with the parsed MSBuild switches.
Microsoft.Build.CommandLine.Experimental.CommandLineParser.Parse(IEnumerable<string>)currently ends inCommandLineSwitches.ThrowErrors(), so an unknown switch raisesUnknownSwitchError. Callers that need to distinguish MSBuild options from arguments intended for another process cannot use it for classification, because those non-MSBuild arguments are expected input rather than errors.This is needed by the .NET SDK as it evaluates using MSBuild's parser to replace hand-maintained switch allowlists; see dotnet/sdk#56123. The parser was extracted for reuse in dotnet/msbuild#12836.