Mono.Options.OptionSet.Add Method
Registers each alias within prototype so that any options matching the aliases in prototype will be handled by action during any subsequent OptionSet.Parse(IEnumerable<string>) calls.

Syntax

public OptionSet Add (string prototype, string description, Action<string> action)

See Also

OptionSet.Add(Option)

Parameters

prototype
A string containing all option aliases to register, an (optional) type specifier, and an (optional) value separator list; see Option(string, string, int) for details.
description
A string containing to used to initialize the Option.Description property.
action
A Action<string> to invoke when an option is parsed.

Returns

The current Mono.Options.OptionSet instance. This is to permit method chaining.

Exceptions

TypeReason
ArgumentException option has an alias (as returned from Option.GetNames) that conflicts with a previously registered Mono.Options.Option.
ArgumentNullException

prototype is null

-or-

action is null

Remarks

Requirements

Namespace: Mono.Options
Assembly: Mono.Options (in Mono.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0