File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ Here's a simple "Hello World" command-line application:
1111``` csharp
1212using System .CommandLine ;
1313
14- var rootCommand = new RootCommand (" Sample command-line app" );
14+ RootCommand rootCommand = new (" Sample command-line app" );
1515
16- var nameOption = new Option < string > (" --name" , " -n" )
16+ Option < string > nameOption = new (" --name" , " -n" )
1717{
1818 Description = " Your name"
1919};
@@ -26,7 +26,7 @@ rootCommand.SetAction(parseResult =>
2626 Console .WriteLine ($" Hello, {name ?? " World" }!" );
2727});
2828
29- return await rootCommand .Parse (args ).InvokeAsync ();
29+ return rootCommand .Parse (args ).Invoke ();
3030```
3131
3232### Commands with Arguments
@@ -109,7 +109,7 @@ rootCommand.Subcommands.Add(configCommand);
109109// Usage: myapp config get --key "apiUrl"
110110```
111111
112- ### Using Options in Command Handlers
112+ ### Using Options in Command Actions
113113
114114Access option values through the ParseResult:
115115
You can’t perform that action at this time.
0 commit comments