Skip to content

Commit 7867fdd

Browse files
committed
Use an IConsole instance to register and handle cancellation when CTRL+C is pressed
1 parent 74db965 commit 7867fdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Microsoft.OpenApi.Hidi/Handlers/TransformCommandHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public async Task<int> InvokeAsync(InvocationContext context)
5050
string filterbyoperationids = context.ParseResult.GetValueForOption(FilterByOperationIdsOption);
5151
string filterbytags = context.ParseResult.GetValueForOption(FilterByTagsOption);
5252
string filterbycollection = context.ParseResult.GetValueForOption(FilterByCollectionOption);
53+
54+
var console = context.Console;
5355
CancellationToken cancellationToken = (CancellationToken)context.BindingContext.GetService(typeof(CancellationToken));
5456

5557
using var loggerFactory = Logger.ConfigureLogger(logLevel);

0 commit comments

Comments
 (0)