Skip to content

Commit e8c8115

Browse files
committed
Fixed parsing of command line with quotes
1 parent 5972e41 commit e8c8115

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

AuthenticodeLint/CommandLineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static IEnumerable<CommandLineParameter> CreateCommandLineParametersWithV
4747
}
4848
else
4949
{
50-
yield return new CommandLineParameter(parameterName.ToLowerInvariant(), token);
50+
yield return new CommandLineParameter(parameterName.ToLowerInvariant(), token.Trim('"'));
5151
parameterName = null;
5252
}
5353
}

AuthenticodeLint/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ class Program
99
{
1010
static int Main(string[] args)
1111
{
12-
13-
var commandLineRaw = string.Join(" ", args);
12+
var cli = Environment.CommandLine;
1413
List<CommandLineParameter> parsedCommandLine;
1514
try
1615
{
17-
var commandLine = CommandLineParser.LexCommandLine(commandLineRaw);
16+
var commandLine = CommandLineParser.LexCommandLine(cli).Skip(1);
1817
parsedCommandLine = CommandLineParser.CreateCommandLineParametersWithValues(commandLine).ToList();
1918
}
2019
catch(InvalidOperationException)

0 commit comments

Comments
 (0)