Skip to content

Commit 86dba48

Browse files
committed
text
1 parent 7a6f21e commit 86dba48

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Program.Options.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,56 @@ partial class Program
1111
/// </summary>
1212
private sealed class Options
1313
{
14-
[Option('e', "excel", Required=true, HelpText = "输入的Excel文件路径.")]
14+
[Option('e', "excel", Required=true, HelpText = "input excel file path.")]
1515
public string ExcelPath
1616
{
1717
get;
1818
set;
1919
}
2020

21-
[Option('j', "json", Required = false, HelpText = "指定输出的json文件路径.")]
21+
[Option('j', "json", Required = false, HelpText = "export json file path.")]
2222
public string JsonPath
2323
{
2424
get;
2525
set;
2626
}
2727

28-
[Option('s', "sql", Required = false, HelpText = "指定输出的SQL文件路径.")]
28+
[Option('s', "sql", Required = false, HelpText = "export SQL file path.")]
2929
public string SQLPath
3030
{
3131
get;
3232
set;
3333
}
3434

35-
[Option('p', "csharp", Required = false, HelpText = "指定输出的C#数据定义代码文件路径.")]
35+
[Option('p', "csharp", Required = false, HelpText = "export C# data struct code file path.")]
3636
public string CSharpPath
3737
{
3838
get;
3939
set;
4040
}
4141

42-
[Option('h', "header", Required = true, HelpText = "表格中有几行是表头.")]
42+
[Option('h', "header", Required = true, HelpText = "number lines in sheet as header.")]
4343
public int HeaderRows
4444
{
4545
get;
4646
set;
4747
}
4848

49-
[Option('c', "encoding", Required = false, DefaultValue="utf8-nobom", HelpText = "指定编码的名称.")]
49+
[Option('c', "encoding", Required = false, DefaultValue="utf8-nobom", HelpText = "export file encoding.")]
5050
public string Encoding
5151
{
5252
get;
5353
set;
5454
}
5555

56-
[Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "字段名称自动转换为小写")]
56+
[Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "convert filed name to lowcase.")]
5757
public bool Lowcase
5858
{
5959
get;
6060
set;
6161
}
6262

63-
[Option('a', "array", Required = false, DefaultValue = false, HelpText = "导出为数组")]
63+
[Option('a', "array", Required = false, DefaultValue = false, HelpText = "export as array, otherwise as dict object.")]
6464
public bool ExportArray
6565
{
6666
get;

Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void Main(string[] args)
4040
System.DateTime endTime = System.DateTime.Now;
4141
System.TimeSpan dur = endTime - startTime;
4242
Console.WriteLine(
43-
string.Format("[{0}]:\t转换完成[{1}毫秒].",
43+
string.Format("[{0}]:\tConversion complete in [{1}ms].",
4444
Path.GetFileName(options.ExcelPath),
4545
dur.TotalMilliseconds)
4646
);
@@ -68,14 +68,14 @@ private static void Run(Options options)
6868
// 数据检测
6969
if (book.Tables.Count < 1)
7070
{
71-
throw new Exception("Excel文件中没有找到Sheet: " + excelPath);
71+
throw new Exception("Excel file is empty: " + excelPath);
7272
}
7373

7474
// 取得数据
7575
DataTable sheet = book.Tables[0];
7676
if (sheet.Rows.Count <= 0)
7777
{
78-
throw new Exception("Excel Sheet中没有数据: " + excelPath);
78+
throw new Exception("Excel Sheet is empty: " + excelPath);
7979
}
8080

8181
//-- 确定编码

0 commit comments

Comments
 (0)