Skip to content

Commit b4884b8

Browse files
authored
Update How-To.md
1 parent d96b25f commit b4884b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/How-To.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static async Task Main(string[] args)
6969
{
7070
var rootCommand = new RootCommand();
7171

72-
rootCommand.Handler = CommandHandler.Create(() =>
72+
rootCommand.SetHandler(() =>
7373
{
7474
/* do something */
7575
});
@@ -103,7 +103,7 @@ static async Task Main(string[] args)
103103
rootCommand.Add(new Option<int>("--an-int"));
104104
rootCommand.Add(new Option<string>("--a-string"));
105105

106-
rootCommand.Handler = CommandHandler.Create<int, string>(DoSomething);
106+
rootCommand.SetHandler((int i, string s) => DoSomething(i, s));
107107

108108
await rootCommand.InvokeAsync(args);
109109
}

0 commit comments

Comments
 (0)