NDesk.Options : NDesk.Options Namespace

NDesk.Options

GIT Repository

OptionContext Class

Provides additional context information about the current NDesk.Options.Option which is being parsed.

public class OptionContext


Remarks

An instance of this class is provided via the registered callback when you override the Option.OnParseComplete(OptionContext) method.

Members

See Also: Inherited members from object.

Constructors

Constructs and initializes a new instance of the NDesk.Options.OptionContext class.

Properties

Option
Option . The NDesk.Options.Option being parsed.
OptionIndex
int . The index within the options list of the last value within OptionContext.OptionValues.
OptionName
string . The actual option name used.
OptionSet [read-only]
OptionSet . The NDesk.Options.OptionSet to use for message localizations.
OptionValues [read-only]
OptionValueCollection . A collection of string values to provide to OptionContext.Option.

Member Details

OptionContext Constructor

Constructs and initializes a new instance of the NDesk.Options.OptionContext class.

public OptionContext (OptionSet set)

Parameters

set
The NDesk.Options.OptionSet instance to use for message localization purposes.

Remarks

This constructor initializes the OptionContext.OptionSet property of the new instance using set.

Version Information:

  • NDesk.Options 0.2.0.0

Option Property

The NDesk.Options.Option being parsed.

public Option Option { set; get; }

OptionIndex Property

The index within the options list of the last value within OptionContext.OptionValues.

public int OptionIndex { set; get; }

OptionName Property

The actual option name used.

public string OptionName { set; get; }

Value

A string containing the actual option name used.

Remarks

A Option.Prototype can contain multiple |-delimited aliases, e.g. h|help. This property contains the actual option name specified, e.g. -h vs. --help.

Version Information:

  • NDesk.Options 0.2.0.0

OptionSet Property

The NDesk.Options.OptionSet to use for message localizations.

public OptionSet OptionSet { get; }

Value

The NDesk.Options.OptionSet to use for message localizations.

Remarks

This property is initialized in the OptionContext(OptionSet) constructor.

Version Information:

  • NDesk.Options 0.2.0.0

OptionValues Property

A collection of string values to provide to OptionContext.Option.

public OptionValueCollection OptionValues { get; }

Value

Remarks

The NDesk.Options.OptionValueCollection indexer makes use of the Option.OptionValueType and Option.MaxValueCount properties. If the index does not have a value, the index is less than Option.MaxValueCount, and the OptionContext.Option has a value type of OptionValueType.Optional, null is returned; otherwise an NDesk.Options.OptionException is thrown.

Version Information:

  • NDesk.Options 0.2.0.0