Skip to content

Commit ef8359f

Browse files
committed
Clean up output from the analysis tool
1 parent 0102ef6 commit ef8359f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

StyleCop.Analyzers.Status.Generator/Program.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@ internal class Program
1919
/// The starting point of this application.
2020
/// </summary>
2121
/// <param name="args">The command line parameters.</param>
22-
internal static void Main(string[] args)
22+
/// <returns>Zero if the tool completes successfully; otherwise, a non-zero error code.</returns>
23+
internal static int Main(string[] args)
2324
{
2425
if (args.Length < 1)
2526
{
2627
Console.WriteLine("Path to sln file required.");
27-
return;
28+
return 1;
29+
}
30+
31+
if (!File.Exists(args[0]))
32+
{
33+
Console.WriteLine($"Could not find solution file: {Path.GetFullPath(args[0])}");
34+
return 1;
2835
}
2936

3037
MSBuildLocator.RegisterDefaults();
@@ -55,8 +62,10 @@ internal static void Main(string[] args)
5562
}
5663
};
5764

58-
Console.WriteLine(JsonConvert.SerializeObject(output));
65+
Console.WriteLine(JsonConvert.SerializeObject(output, Formatting.Indented));
5966
}
67+
68+
return 0;
6069
}
6170
}
6271
}

0 commit comments

Comments
 (0)