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, OptionAction<string, string> action)

See Also

OptionSet.Add(string, string, OptionAction<string, string>)
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.
action
A Mono.Options.OptionAction<string, string> to invoke when an option is parsed.

Returns

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

Exceptions

TypeReason
ArgumentException prototype 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

Calls OptionSet.Add(string, string, OptionAction<string, string>) with a description value of null.

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