diff --git a/ILSpy.Tests/CommandLineArgumentsTests.cs b/ILSpy.Tests/CommandLineArgumentsTests.cs index 0d6626d9c..76f9cc479 100644 --- a/ILSpy.Tests/CommandLineArgumentsTests.cs +++ b/ILSpy.Tests/CommandLineArgumentsTests.cs @@ -1,4 +1,6 @@ -using FluentAssertions; +using System; + +using FluentAssertions; using NUnit.Framework; @@ -36,6 +38,22 @@ namespace ICSharpCode.ILSpy.Tests cmdLineArgs.NavigateTo.Should().BeEquivalentTo(navigateTo); } + [Test] + public void VerifyNavigateToOption_NoneTest_Matching_VSAddin() + { + var cmdLineArgs = new CommandLineArguments(new string[] { "--navigateto:none" }); + cmdLineArgs.NavigateTo.Should().BeEquivalentTo("none"); + } + + [Test] + public void VerifyCaseSensitivityOfOptionsThrows() + { + Action act = () => new CommandLineArguments(new string[] { "--navigateTo:none" }); + + act.Should().Throw() + .WithMessage("Unrecognized option '--navigateTo:none'"); + } + [Test] public void VerifySearchOption() { diff --git a/ILSpy/CommandLineArguments.cs b/ILSpy/CommandLineArguments.cs index 7822743bb..30a887b79 100644 --- a/ILSpy/CommandLineArguments.cs +++ b/ILSpy/CommandLineArguments.cs @@ -39,6 +39,9 @@ namespace ICSharpCode.ILSpy var app = new CommandLineApplication() { // https://natemcmaster.github.io/CommandLineUtils/docs/response-file-parsing.html?tabs=using-attributes ResponseFileHandling = ResponseFileHandling.ParseArgsAsSpaceSeparated, + + // Note: options are case-sensitive (!), and, default behavior would be UnrecognizedArgumentHandling.Throw on Parse() + // UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue }; var oForceNewInstance = app.Option("--newinstance",