-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
40 lines (39 loc) · 2.02 KB
/
Program.cs
File metadata and controls
40 lines (39 loc) · 2.02 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
using CommandLine;
using System;
using System.Text.RegularExpressions;
namespace CodeSmellFinder
{
internal class Program
{
public static void Main(string[] args)
{
Parser.Default.ParseArguments<Options>(args).WithParsed(o => SmellAnalyzer.Init(o));
if (SmellAnalyzer.DataPath != null || SmellAnalyzer.Expose)
{
SmellAnalyzer.Analyze();
Environment.Exit(0);
}
}
}
public class Options
{
[Option('e', "expose", SetName = "exp", Required = true, HelpText = "Exposes all possible smell names, Mutually exclusive with -d, --data")]
public bool Expose { get; set; }
[Option('d', "data", SetName = "dat", Required = true, HelpText = "json file name produced by the Code Analyzer, Mutually exclusive with -e, --expose")]
public string DataPath { get; set; }
[Option('s', "smell", Required = false, HelpText = "Searches for a single smell")]
public string Smell { get; set; }
[Option('f', "file", Required = false, HelpText = "Textual file with the list of smells to search for (use the names produced by the -e option)")]
public string SmellPath { get; set; }
[Option('v', "verbose", Required = false, HelpText = "Enables the status log on the console window")]
public bool Verbose { get; set; }
[Option('p', "project", Required = false, HelpText = "Saves the number of smells for the project in a .csv file")]
public bool NumSmellForProject { get; set; }
[Option('c', "category", Required = false, HelpText = "Saves the smells by category")]
public bool SmellForFile { get; set; }
[Option('r', "result", Required = false, HelpText = "Save results into a specified folder")]
public string SaveDirectory { get; set; }
[Option('l', "log", Required = false, 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; }
}
}