commandlineparser / commandlineparser/commandline
Outputting help text as individual lines
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 478
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the DisplayHelp example in the issue and inspect the HelpText.AutoBuild result and the logging call shown there. Determine how the generated help text should be split for individual Log.Information calls, then verify the output preserves each help line as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100