File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Extensions/FreeSql.Generator Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments