Skip to content

Commit 3fe4b44

Browse files
2881028810
authored andcommitted
- 增加 FreeSql.Generator 参数 -readkey 0 的设置;
1 parent 3812a17 commit 3fe4b44

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Extensions/FreeSql.Generator/ConsoleApp.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class ConsoleApp
2323
string ArgsFilter { get; }
2424
string ArgsMatch { get; }
2525
string ArgsFileName { get; }
26+
bool ArgsReadKey { get; }
2627
internal string ArgsOutput { get; private set; }
2728

2829
public ConsoleApp(string[] args, ManualResetEvent wait)
@@ -62,6 +63,7 @@ public ConsoleApp(string[] args, ManualResetEvent wait)
6263
ArgsFilter = "";
6364
ArgsMatch = "";
6465
ArgsFileName = "{name}.cs";
66+
ArgsReadKey = true;
6567
Action<string> setArgsOutput = value =>
6668
{
6769
ArgsOutput = value;
@@ -196,6 +198,10 @@ public ConsoleApp(string[] args, ManualResetEvent wait)
196198
ArgsFileName = args[a + 1];
197199
a++;
198200
break;
201+
case "-readkey":
202+
ArgsReadKey = args[a + 1].Trim() == "1";
203+
a++;
204+
break;
199205
case "-output":
200206
setArgsOutput(args[a + 1]);
201207
a++;
@@ -321,7 +327,8 @@ public ConsoleApp(string[] args, ManualResetEvent wait)
321327

322328
Console.WriteFormatted($"\r\n[{DateTime.Now.ToString("MM-dd HH:mm:ss")}] 生成完毕,总共生成了 {outputCounter} 个文件,目录:\"{ArgsOutput}\"\r\n", Color.DarkGreen);
323329

324-
Console.ReadKey();
330+
if (ArgsReadKey)
331+
Console.ReadKey();
325332
wait.Set();
326333
}
327334
}

0 commit comments

Comments
 (0)