It's currently the only attribute that is applied to a method. Inherits from
CommandLine.BaseOptionAttribute so that you can define both names, but as default its short name is null and
help is its long name.
Here is an example.
[HelpOption(HelpText = "Dispaly this help screen.")]
public string GetUsage()
var help = new StringBuilder();
help.AppendLine("Guide Application Help Screen!");
As you can see the method signature is very simple: public string AnyName() (but I suggest
GetUsage). The method must be an instance method. In particular conditions, the parser will call this method to get the help screen to be presented to the user (more on this topic later).
Obviously you are free to use it how, where and when it sees fit.
var options = new Options;
// ... here the parsing process ...
Of course you can display an help screen much more complex than the one built here using the
System.Text.StringBuilder type in this simple way. The types contained in
CommandLine.Text are dedicated to this purpose. This will be explained in depth more ahead.