CommandLineParserHelpRequested Property

Gets or sets a value that indicates whether usage help should be displayed if the Parse(String) method returned .

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public bool HelpRequested { get; set; }

Property Value

Boolean
if usage help should be displayed; otherwise, .

Remarks

Check this property after calling the Parse(String) method or one of its overloads to see if usage help should be displayed.

This property will always be if the Parse(String) method returned a non- value.

This property will always be if the Parse(String) method threw a CommandLineArgumentException, or if an argument used CancelModeAbort with the CommandLineArgumentAttributeCancelParsing property or the ArgumentParsed event.

If an argument that is defined by a method (ArgumentKindMethod) cancels parsing by returning CancelModeAbort or from the method, this property is not automatically set to . Instead, the method should explicitly set the HelpRequested property if it wants usage help to be displayed.

C#
[CommandLineArgument]
public static CancelMode MethodArgument(CommandLineParser parser)
{
    parser.HelpRequested = true;
    return CancelMode.Abort;
}

See Also