forked from exercism/csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
34 lines (26 loc) · 868 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
using CommandLine;
using Exercism.CSharp.Exercises;
using Serilog;
namespace Exercism.CSharp;
public static class Program
{
public static void Main(string[] args)
{
Logging.Setup();
Options.Parse(args)
.WithParsed(OnParseSuccess)
.WithNotParsed(OnParseError);
}
private static void OnParseSuccess(Options options)
{
var generatorRunner = new GeneratorRunner(options);
// TODO: enable nullable
if (options.Exercise == null)
generatorRunner.RegenerateAllExercises();
else
generatorRunner.RegenerateSingleExercise(options.Exercise);
}
private static void OnParseError(IEnumerable<Error> errors) =>
Log.Error("Errors: {Errors}", errors);
}