forked from MatteoBosco89/UnityCodeSmellAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
46 lines (43 loc) · 2.17 KB
/
Program.cs
File metadata and controls
46 lines (43 loc) · 2.17 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
using CommandLine;
using System;
namespace CSharpAnalyzer
{
/// <summary>
/// Main
/// </summary>
internal class Program
{
public static void Main(string[] args)
{
Parser.Default.ParseArguments<Options>(args).WithParsed(o => AnalyzerConfiguration.Init(o));
if (AnalyzerConfiguration.ProjectPath == null) { Logger.Log(Logger.LogLevel.Critical, "Project cannot be reached"); Environment.Exit(1); }
ProjectSchema projectSchema = new ProjectSchema();
projectSchema.Analyze();
Environment.Exit(0);
}
}
/// <summary>
/// Command Line Options Wrapper
/// </summary>
public class Options
{
[Option('p', "project", Required = true, HelpText = "Project directory.")]
public string ProjectPath { get; set; }
[Option('r', "results", Required = false, HelpText = "Directory where to store the results (CodeAnalysis.json file). If not provided, results are saved in the current directory.")]
public string Results { get; set; }
[Option('d', "directory", Required = false, HelpText = "Analyze the specified directory only. If not provided, the project directory is selected.")]
public string Directory { get; set; }
[Option('a', "assembly", Required = false, HelpText = "Additional assemblies directory (i.e., to analyze DLLs).")]
public string AssemblyDir { get; set; }
[Option('s', "statements", Required = false, HelpText = "Set output all statements.")]
public bool Statements { get; set; }
[Option('n', "name", Required = false, HelpText = "The project name.")]
public string ProjectName { get; set; }
[Option('c', "config", Required = false, HelpText = "Configuration File.")]
public string ConfigFile { get; set; }
[Option('l', "log", Required = false, Default = 1, HelpText = "Log Level: Trace 0 Debug 1 Information 2 Warning 3 Error 4 Critical 5 None 6 (Debug is Default).")]
public int Logging { get; set; }
[Option('v', "verbose", Required = false, HelpText = "Displays the log on the standard output.")]
public bool Verbose { get; set; }
}
}