- 增加 FreeSql.Generator 参数 -readkey 0 的设置;

This commit is contained in:
28810 2020-10-18 21:44:56 +08:00
parent 3812a1736a
commit 3fe4b44ca8

View File

@ -23,6 +23,7 @@ namespace FreeSql.Generator
string ArgsFilter { get; }
string ArgsMatch { get; }
string ArgsFileName { get; }
bool ArgsReadKey { get; }
internal string ArgsOutput { get; private set; }
public ConsoleApp(string[] args, ManualResetEvent wait)
@ -62,6 +63,7 @@ new Colorful.Formatter("v" + string.Join(".", typeof(ConsoleApp).Assembly.GetNam
ArgsFilter = "";
ArgsMatch = "";
ArgsFileName = "{name}.cs";
ArgsReadKey = true;
Action<string> setArgsOutput = value =>
{
ArgsOutput = value;
@ -196,6 +198,10 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat双击它重新
ArgsFileName = args[a + 1];
a++;
break;
case "-readkey":
ArgsReadKey = args[a + 1].Trim() == "1";
a++;
break;
case "-output":
setArgsOutput(args[a + 1]);
a++;
@ -321,6 +327,7 @@ FreeSql.Generator -Razor ""__razor.cshtml.txt"" -NameOptions {string.Join(",", A
Console.WriteFormatted($"\r\n[{DateTime.Now.ToString("MM-dd HH:mm:ss")}] 生成完毕,总共生成了 {outputCounter} 个文件,目录:\"{ArgsOutput}\"\r\n", Color.DarkGreen);
if (ArgsReadKey)
Console.ReadKey();
wait.Set();
}