Add<TCommand, T>(TCommand, String, String?, ICollection, String, Nullable) Method

Definition

Assembly XenoAtom.CommandLine.dll

Adds an option which expects a specified type and appends parsed values to the specified list, with an environment variable fallback.

public static TCommand Add<TCommand, T>(this TCommand command, string prototype, string? description, ICollection<T> list, string envVar, char? envVarDelimiter = default(char? ))
    where TCommand : CommandContainer where T : ISpanParsable<T>

Type parameters

TCommand
Type of the command container.
T
The value type of the option.

Parameters

command
{TCommand}

The command to add the option to.

prototype
String

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

description
String

The help description for this option.

list
ICollection<T>

The associated list receiving option values.

envVar
String

The environment variable used as a fallback value.

envVarDelimiter
Nullable<Char>

Optional delimiter used to split multiple fallback values.

Returns

{TCommand}
The command container.