Skip to content

Outputting help text as individual lines #559

Open
@tig

Description

@tig

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<T>(ParserResult<T> result, IEnumerable<Error> errs) {
            var helpText = HelpText.AutoBuild(result, h => {
                h.AutoHelp = true;
                h.AutoVersion = true;
                return HelpText.DefaultParsingErrorsHandler(result, h);
            }, e => e);
            Log.Information(helpText);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions