This repository was archived by the owner on Aug 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
53 lines (43 loc) · 1.56 KB
/
Copy pathProgram.cs
File metadata and controls
53 lines (43 loc) · 1.56 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using CommandLine;
namespace DocumentationGenerator
{
class Program
{
class Options
{
[Option( 'l', "library", Required = true, HelpText = "Libraries to be parsed" )]
public string Library { get; set; }
[Option( 'o', "output", Required = true, HelpText = "Output folder" )]
public string TargetFolder { get; set; }
[Option( 'd', "delete", Required = false, HelpText = "Clear everything" )]
public bool Erase { get; set; }
}
static void Main( string[] args )
{
var options = CommandLine.Parser.Default.ParseArguments<Options>( args );
if ( options.Errors.Any() )
return;
if ( !System.IO.Directory.Exists( options.Value.TargetFolder ) )
System.IO.Directory.CreateDirectory( options.Value.TargetFolder );
if ( options.Value.Erase )
{
foreach ( var f in System.IO.Directory.EnumerateFiles( options.Value.TargetFolder ) )
{
System.IO.File.Delete( f );
}
}
var dg = new DocGen();
dg.AddLibrary( options.Value.Library );
dg.Process();
var output = new GithubOutput();
output.DocGen = dg;
output.ToFolder( new System.IO.DirectoryInfo( options.Value.TargetFolder ) );
}
}
}