Skip to content

Commit 2445be9

Browse files
committed
Declare the return type as a task of type int in Main() method for us to get the correct exit code in case of a critical error or unsuccessful operation
1 parent 1a42bc4 commit 2445be9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Microsoft.OpenApi.Hidi/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ namespace Microsoft.OpenApi.Hidi
1515
{
1616
static class Program
1717
{
18-
static async Task Main(string[] args)
18+
static async Task<int> Main(string[] args)
1919
{
2020
var rootCommand = CreateRootCommand();
2121

2222
// Parse the incoming args and invoke the handler
23-
await rootCommand.InvokeAsync(args);
24-
23+
return await rootCommand.InvokeAsync(args);
2524
}
2625

2726
internal static RootCommand CreateRootCommand()

0 commit comments

Comments
 (0)