Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions tools/StaticAnalysis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void Main(string[] args)
if (args.Any(a => a == "--package-directory" || a == "-p"))
{
int idx = Array.FindIndex(args, a => a == "--package-directory" || a == "-p");
if (idx == args.Length)
if (idx + 1 == args.Length)
{
throw new ArgumentException("No value provided for the --package-directory parameter.");
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public static void Main(string[] args)
if (args.Any(a => a == "--reports-directory" || a == "-r"))
{
int idx = Array.FindIndex(args, a => a == "--reports-directory" || a == "-r");
if (idx == args.Length)
if (idx + 1 == args.Length)
{
throw new ArgumentException("No value provided for the --reports-directory parameter.");
}
Expand All @@ -98,12 +98,14 @@ public static void Main(string[] args)
if (args.Any(a => a == "--modules-to-analyze" || a == "-m"))
{
int idx = Array.FindIndex(args, a => a == "--modules-to-analyze" || a == "-m");
if (idx == args.Length)
if (idx + 1 == args.Length)
{
throw new ArgumentException("No value provided for the --modules-to-analyze parameter.");
Console.WriteLine("No value provided for the --modules-to-analyze parameter. Filtering over all built modules.");
}
else
{
modulesToAnalyze = args[idx + 1].Split(';').ToList();
}

modulesToAnalyze = args[idx + 1].Split(';').ToList();
}

bool useNetcore = args.Any(a => a == "--use-netcore" || a == "-u");
Expand Down