diff --git a/ILSpy.Tests/CommandLineArgumentsTests.cs b/ILSpy.Tests/CommandLineArgumentsTests.cs index 659281df9..026c86b81 100644 --- a/ILSpy.Tests/CommandLineArgumentsTests.cs +++ b/ILSpy.Tests/CommandLineArgumentsTests.cs @@ -53,12 +53,11 @@ namespace ICSharpCode.ILSpy.Tests } [Test] - public void VerifyCaseSensitivityOfOptionsThrows() + public void VerifyCaseSensitivityOfOptionsDoesntThrow() { - Action act = () => new CommandLineArguments(new string[] { "--navigateTo:none" }); + var cmdLineArgs = new CommandLineArguments(new string[] { "--navigateTo:none" }); - act.Should().Throw() - .WithMessage("Unrecognized option '--navigateTo:none'"); + cmdLineArgs.ArgumentsParser.RemainingArguments.Should().HaveCount(1); } [Test] diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs index 5947d08bc..5779727c4 100644 --- a/ILSpy/App.xaml.cs +++ b/ILSpy/App.xaml.cs @@ -92,6 +92,12 @@ namespace ICSharpCode.ILSpy { MessageBox.Show(App.CommandLineArguments.ArgumentsParser.GetHelpText(), "ILSpy Command Line Arguments"); } + + if (App.CommandLineArguments.ArgumentsParser.RemainingArguments.Any()) + { + string unknownArguments = string.Join(", ", App.CommandLineArguments.ArgumentsParser.RemainingArguments); + MessageBox.Show(unknownArguments, "ILSpy Unknown Command Line Arguments Passed"); + } } static Assembly ResolvePluginDependencies(AssemblyLoadContext context, AssemblyName assemblyName) diff --git a/ILSpy/CommandLineArguments.cs b/ILSpy/CommandLineArguments.cs index d48141480..df1114e38 100644 --- a/ILSpy/CommandLineArguments.cs +++ b/ILSpy/CommandLineArguments.cs @@ -43,7 +43,7 @@ namespace ICSharpCode.ILSpy ResponseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated, // Note: options are case-sensitive (!), and, default behavior would be UnrecognizedArgumentHandling.Throw on Parse() - // UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue + UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue }; app.HelpOption(); diff --git a/ILSpy/Properties/launchSettings.json b/ILSpy/Properties/launchSettings.json index f986930a4..79731519a 100644 --- a/ILSpy/Properties/launchSettings.json +++ b/ILSpy/Properties/launchSettings.json @@ -2,12 +2,12 @@ "profiles": { "ILSpy": { "commandName": "Executable", - "executablePath": ".\\ILSpy.exe", + "executablePath": "./ilspy.exe", "commandLineArgs": "--newinstance" }, "ILSpy single-instance": { "commandName": "Executable", - "executablePath": ".\\ILSpy.exe" + "executablePath": "./ilspy.exe" } } } \ No newline at end of file