dotnet / dotnet/command-line-api
Fluent interface for System.CommandLine
- Vorherrschende Sprache
- C#
- Sterne
- 3.7k
- Forks
- 428
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hello everybody,
I have written a fluent interface for the System.CommandLine
Below is the sample from your wiki in fluent form.
```csharp
static Task Main(string[] args)
=> args.ArgsCommandBuilder("My sample app")
.Option("--int-option", 42, "An option whose argument is parsed as an int")
.Option("--bool-option", default, "An option whose argument is parsed as a bool")
.Option("--file-option", default, "An option whose argument is parsed as a FileInfo")
.OnRootCommand((intOption, boolOption, fileOption) =>
{
Console.WriteLine($"The value for --int-option is: {intOption}");
Console.WriteLine($"The value for --bool-option is: {boolOption}");
Console.WriteLine($"The value for --file-option is: {fileOption?.FullName ?? "null"}");
})
.RunAsync();
```
More doc, code, tests and samples can be found on [my github side](https://github.com/EifelMono/EifelMono.ConsoleApp)
I would like to bring this in these project if you think it is useful for others and fits in this project
Beitragsleitfaden
Rechercherichtung
Überprüfe die Dokumentation, den Code, die Tests und die Beispiele der Fluent-Interface im verlinkten Repository EifelMono.ConsoleApp und vergleiche deren Beispielverwendung mit den Befehlszeilen-APIs dieses Projekts. Bestimme, ob die vorgeschlagene Schnittstelle zu diesem Projekt passt, und definiere den erforderlichen Integrationsumfang; als abgeschlossen gilt dies, wenn für die Übernahme oder Ablehnung ein entschiedener, dokumentierter Weg festgelegt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- cli
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100