forked from EventStore/EventStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocumentationGeneration.cs
39 lines (38 loc) · 1.32 KB
/
DocumentationGeneration.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
35
36
37
38
39
using EventStore.Common.Options;
using EventStore.Rags;
using System;
namespace EventStore.Documentation
{
public class DocumentationGenerationOptions
{
[ArgDescription("Path to the EventStore Binaries (e.g. c:\\EventStore\\)")]
public string[] EventStoreBinaryPaths { get; set; }
[ArgDescription("Output location of the generated Markdown File (e.g. c:\\generated_docs\\documentation.md)")]
public string OutputPath { get; set; }
public DocumentationGenerationOptions()
{
OutputPath = "documentation.md";
}
}
class DocumentationGeneration
{
public static int Main(string[] args)
{
try
{
var options = CommandLine.Parse<DocumentationGenerationOptions>(args)
.Cleanup()
.ApplyTo<DocumentationGenerationOptions>();
var generator = new DocumentGenerator();
generator.Generate(options.EventStoreBinaryPaths, options.OutputPath);
return 0;
}
catch (Exception ex)
{
Console.Write(ArgUsage.GetUsage<DocumentationGenerationOptions>());
Console.Error.WriteLine(ex.Message);
}
return 1;
}
}
}