forked from neil3d/excel2json
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.Options.cs
64 lines (57 loc) · 1.7 KB
/
Program.Options.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using CommandLine;
using CommandLine.Text;
namespace excel2json
{
partial class Program
{
/// <summary>
/// 命令行参数定义
/// </summary>
private sealed class Options
{
[Option('e', "excel", Required=true, HelpText = "输入的Excel文件路径.")]
public string ExcelPath
{
get;
set;
}
[Option('j', "json", Required = false, HelpText = "指定输出的json文件路径.")]
public string JsonPath
{
get;
set;
}
[Option('s', "sql", Required = false, HelpText = "指定输出的SQL文件路径.")]
public string SQLPath
{
get;
set;
}
[Option('p', "csharp", Required = false, HelpText = "指定输出的C#数据定义代码文件路径.")]
public string CSharpPath
{
get;
set;
}
[Option('h', "header", Required = true, HelpText = "表格中有几行是表头.")]
public int HeaderRows
{
get;
set;
}
[Option('c', "encoding", Required = false, DefaultValue="utf8-nobom", HelpText = "指定编码的名称.")]
public string Encoding
{
get;
set;
}
[Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "字段名称自动转换为小写")]
public bool Lowcase
{
get;
set;
}
}
}
}