Skip to content

Commit 6f893f4

Browse files
committed
デバッグ用のエントリポイントを追加
1 parent c23cec2 commit 6f893f4

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

FastChatProtocolInterface/Program.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,32 @@
55
* distributed under the MIT License.
66
****/
77

8+
using System.Runtime.CompilerServices;
9+
10+
#if !DEBUG
811
using System;
12+
#endif
913

1014
namespace FastChatProtocolInterface
1115
{
1216
internal static class Program
1317
{
18+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
19+
private static void Run(string[] args)
20+
{
21+
var parsedArgs = CommandLineArguments.ParseArgs(args);
22+
parsedArgs.PrintHeader();
23+
parsedArgs.ExecutionMode?.Run(parsedArgs);
24+
}
25+
26+
#if DEBUG
27+
private static void Main(string[] args) => Run(args);
28+
#else
1429
[STAThread()]
1530
private static int Main(string[] args)
1631
{
1732
try {
18-
var parsedArgs = CommandLineArguments.ParseArgs(args);
19-
parsedArgs.PrintHeader();
20-
parsedArgs.ExecutionMode?.Run(parsedArgs);
33+
Run(args);
2134
return 0;
2235
} catch (Exception e) {
2336
Console.ForegroundColor = ConsoleColor.Red;
@@ -27,5 +40,6 @@ private static int Main(string[] args)
2740
return e.HResult;
2841
}
2942
}
43+
#endif
3044
}
3145
}

0 commit comments

Comments
 (0)