Skip to content

Commit 3472eda

Browse files
baronfeladamsitnik
andauthored
Apply suggestions from code review
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
1 parent 9b88558 commit 3472eda

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/System.CommandLine/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Here's a simple "Hello World" command-line application:
1111
```csharp
1212
using 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

114114
Access option values through the ParseResult:
115115

0 commit comments

Comments
 (0)