Skip to content

Provide a better way to hook custom help #2588

Open
@blowdart

Description

@blowdart

Having to define internal sealed class CustomHelpAction(HelpAction action) : SynchronousCommandLineAction and then loop through Options on the rootCommand looking for is HelpOption is a lot of ceremony.

Could we have something like

var rootCommand = new RootCommand("RootCommand")
{
  myArgument,
  myOption1,
  myOption2,
  HelpAction => () { Console.Writeline("Easy help!") }
};

or

rootCommand.SetHelp((cancellationToken) =>
{
   Console.Writeline("Easy help!")
}

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