mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Switch to per-line arguments
This commit is contained in:
@@ -52,7 +52,7 @@ namespace ICSharpCode.ILSpy.AddIn
|
||||
|
||||
if ((commandLineArguments != null) && commandLineArguments.Any())
|
||||
{
|
||||
string assemblyArguments = string.Join(" ", commandLineArguments);
|
||||
string assemblyArguments = string.Join("\r\n", commandLineArguments);
|
||||
|
||||
string filepath = Path.GetTempFileName();
|
||||
File.WriteAllText(filepath, assemblyArguments);
|
||||
|
||||
@@ -100,14 +100,22 @@ namespace ICSharpCode.ILSpy.Tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PassAtFileArgumentsSpaceSeparated()
|
||||
public void PassAtFileArguments()
|
||||
{
|
||||
string filepath = System.IO.Path.GetTempFileName();
|
||||
|
||||
System.IO.File.WriteAllText(filepath, "assembly1 assembly2 assembly3 --newinstance --noactivate");
|
||||
System.IO.File.WriteAllText(filepath, "assembly1\r\nassembly2\r\nassembly3\r\n--newinstance\r\n--noactivate");
|
||||
|
||||
var cmdLineArgs = new CommandLineArguments(new string[] { $"@{filepath}" });
|
||||
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(filepath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
cmdLineArgs.SingleInstance.Should().BeFalse();
|
||||
cmdLineArgs.NoActivate.Should().BeTrue();
|
||||
cmdLineArgs.AssembliesToLoad.Should().HaveCount(3);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace ICSharpCode.ILSpy
|
||||
{
|
||||
var app = new CommandLineApplication() {
|
||||
// https://natemcmaster.github.io/CommandLineUtils/docs/response-file-parsing.html?tabs=using-attributes
|
||||
ResponseFileHandling = ResponseFileHandling.ParseArgsAsSpaceSeparated,
|
||||
ResponseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated,
|
||||
|
||||
// Note: options are case-sensitive (!), and, default behavior would be UnrecognizedArgumentHandling.Throw on Parse()
|
||||
// UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue
|
||||
|
||||
Reference in New Issue
Block a user