diff --git a/Program.Options.cs b/Program.Options.cs index 5491d3c..cc5622a 100644 --- a/Program.Options.cs +++ b/Program.Options.cs @@ -11,56 +11,56 @@ partial class Program /// private sealed class Options { - [Option('e', "excel", Required=true, HelpText = "输入的Excel文件路径.")] + [Option('e', "excel", Required=true, HelpText = "input excel file path.")] public string ExcelPath { get; set; } - [Option('j', "json", Required = false, HelpText = "指定输出的json文件路径.")] + [Option('j', "json", Required = false, HelpText = "export json file path.")] public string JsonPath { get; set; } - [Option('s', "sql", Required = false, HelpText = "指定输出的SQL文件路径.")] + [Option('s', "sql", Required = false, HelpText = "export SQL file path.")] public string SQLPath { get; set; } - [Option('p', "csharp", Required = false, HelpText = "指定输出的C#数据定义代码文件路径.")] + [Option('p', "csharp", Required = false, HelpText = "export C# data struct code file path.")] public string CSharpPath { get; set; } - [Option('h', "header", Required = true, HelpText = "表格中有几行是表头.")] + [Option('h', "header", Required = true, HelpText = "number lines in sheet as header.")] public int HeaderRows { get; set; } - [Option('c', "encoding", Required = false, DefaultValue="utf8-nobom", HelpText = "指定编码的名称.")] + [Option('c', "encoding", Required = false, DefaultValue="utf8-nobom", HelpText = "export file encoding.")] public string Encoding { get; set; } - [Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "字段名称自动转换为小写")] + [Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "convert filed name to lowcase.")] public bool Lowcase { get; set; } - [Option('a', "array", Required = false, DefaultValue = false, HelpText = "导出为数组")] + [Option('a', "array", Required = false, DefaultValue = false, HelpText = "export as array, otherwise as dict object.")] public bool ExportArray { get; diff --git a/Program.cs b/Program.cs index a705fd3..ead0dc2 100644 --- a/Program.cs +++ b/Program.cs @@ -40,7 +40,7 @@ static void Main(string[] args) System.DateTime endTime = System.DateTime.Now; System.TimeSpan dur = endTime - startTime; Console.WriteLine( - string.Format("[{0}]:\t转换完成[{1}毫秒].", + string.Format("[{0}]:\tConversion complete in [{1}ms].", Path.GetFileName(options.ExcelPath), dur.TotalMilliseconds) ); @@ -68,14 +68,14 @@ private static void Run(Options options) // 数据检测 if (book.Tables.Count < 1) { - throw new Exception("Excel文件中没有找到Sheet: " + excelPath); + throw new Exception("Excel file is empty: " + excelPath); } // 取得数据 DataTable sheet = book.Tables[0]; if (sheet.Rows.Count <= 0) { - throw new Exception("Excel Sheet中没有数据: " + excelPath); + throw new Exception("Excel Sheet is empty: " + excelPath); } //-- 确定编码