commandlineparser / commandlineparser/commandline

Outputting help text as individual lines

Offen
#559 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
C#
Sterne
4.8k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Beyond parsing the string into lines, how would I modify this to call `Log.Information()` for each line of help generated? It seems the API is capable of this, but I'm obviously struggling to figure it out myself.

```
static void DisplayHelp(ParserResult result, IEnumerable errs) {
var helpText = HelpText.AutoBuild(result, h => {
h.AutoHelp = true;
h.AutoVersion = true;
return HelpText.DefaultParsingErrorsHandler(result, h);
}, e => e);
Log.Information(helpText);
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.