The Sorcha CLI (sorcha) is a .NET 10 global tool for managing the Sorcha distributed ledger platform. It uses System.CommandLine 2.0.2 for command parsing, Refit for HTTP API clients, and Spectre.Console for rich terminal output.
| Option constructor | new Option ("--id", "Description") | new Option ("--id", "-i") | | Add short alias | option.Aliases.Add("-i") | Second constructor param | | Option name property | Returns "--id" (with dashes) | Does NOT return "id" | | Get option value | parseResult.GetValue(option) | parseResult.GetValueForOption() |
| Set action | this.SetAction(async (pr, ct) => {...}) | Override Execute | | Test find option | o.Name == "--id" | o.Aliases.Contains("--id") |
Erstellt und verwaltet das Sorcha-CLI-Tool mit System.CommandLine 2.0.2, Refit HTTP-Clients und Spectre.Console. Verwendung bei: Erstellen von CLI-Befehlen, Hinzufügen von Optionen/Argumenten, Implementieren von Refit-Service-Clients, Schreiben von CLI-Tests oder Beheben von Problemen mit der Befehlsstruktur. Quelle: stuartf303/sorcha.