Add(TCommand, String, String?, Action<String?>, String, Nullable, Boolean) Method

Definition

Assembly XenoAtom.CommandLine.dll

Adds an option to this command container with an environment variable fallback.

public static TCommand Add<TCommand>(this TCommand command, string prototype, string? description, Action<string?> action, string envVar, char? envVarDelimiter = default(char? ), bool hidden = false)
    where TCommand : CommandContainer

Type parameters

TCommand
Type of the command container.

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.

action
Action<String?>

The associated action.

envVar
String

The environment variable used as a fallback value.

envVarDelimiter
Nullable<Char>

Optional delimiter used to split multiple fallback values.

hidden
Boolean

A boolean indicating if this option is hidden from help.

Returns

{TCommand}
The command container.