Add<TCommand, TKey, TValue>(TCommand, String, String?, Action<TKey, TValue>) Method

Definition

Assembly XenoAtom.CommandLine.dll

Adds to this command container an option which expect a pair of key/value.

public static TCommand Add<TCommand, TKey, TValue>(this TCommand command, string prototype, string? description, Action<TKey, TValue> action)
    where TCommand : CommandContainer where TKey : ISpanParsable<TKey> where TValue : ISpanParsable<TValue>

Type parameters

TCommand
Type of the command container.
TKey
The type of the key.
TValue
The type of the value.

Parameters

command
{TCommand}

The command to add the action to.

prototype
String

The prototype of the option. E.g "v|version".

description
String

The help description for this option.

action
Action<TKey, TValue>

The associated action

Returns

{TCommand}
The command container.

Remarks

Environment-variable fallback and validation delegates are intentionally not supported for key/value option overloads.