Skip to content

Commit a43dfc6

Browse files
committed
fix: properly await banner write and split Parse from InvokeAsync in Program.cs
1 parent da4e90a commit a43dfc6

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

funURL.CLI/Commands/RootCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ private RootCommand()
2121
Subcommands.Add(DedupeCommand.Create());
2222
}
2323

24-
public ParseResult Parse(IReadOnlyList<string> args, CancellationToken cancellationToken)
24+
public async Task<ParseResult> Parse(IReadOnlyList<string> args, CancellationToken cancellationToken)
2525
{
2626
var parseResult = base.Parse(args, null);
2727

2828
if (!parseResult.GetValue(silentOption))
2929
{
30-
Console.Out.WriteAsync(FiggleFonts.Standard.Render("funURL").AsMemory(), cancellationToken);
30+
await Console.Out.WriteAsync(FiggleFonts.Standard.Render("funURL").AsMemory(), cancellationToken);
3131
}
3232

3333
return parseResult;

funURL.CLI/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111

1212
var rootCommand = RootCommand.Create();
1313

14-
return await rootCommand.Parse(args, cancellationToken).InvokeAsync(cancellationToken: cancellationToken);
14+
var parseResult = await rootCommand.Parse(args, cancellationToken);
15+
16+
return await parseResult.InvokeAsync(cancellationToken: cancellationToken);

0 commit comments

Comments
 (0)