ArgumentValidation.AcceptOnlyFromAmong Method

Definition

Overloads

Name Description
AcceptOnlyFromAmong<T>(Argument<T>, String[])

Configures the argument to accept only the specified values, and to suggest them as command line completions.

AcceptOnlyFromAmong<T>(Argument<T>, StringComparer, String[])

Configures the argument to accept only the specified values using the specified comparer, and to suggest them as command line completions.

AcceptOnlyFromAmong<T>(Argument<T>, String[])

Source:
ArgumentValidation.cs
Source:
ArgumentValidation.cs

Configures the argument to accept only the specified values, and to suggest them as command line completions.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::CommandLine::Argument<T> ^ AcceptOnlyFromAmong(System::CommandLine::Argument<T> ^ argument, ... cli::array <System::String ^> ^ values);
public static System.CommandLine.Argument<T> AcceptOnlyFromAmong<T>(this System.CommandLine.Argument<T> argument, params string[] values);
static member AcceptOnlyFromAmong : System.CommandLine.Argument<'T> * string[] -> System.CommandLine.Argument<'T>
<Extension()>
Public Function AcceptOnlyFromAmong(Of T) (argument As Argument(Of T), ParamArray values As String()) As Argument(Of T)

Type Parameters

T

Parameters

argument
Argument<T>

The argument to configure.

values
String[]

The values that are allowed for the argument.

Returns

Applies to

AcceptOnlyFromAmong<T>(Argument<T>, StringComparer, String[])

Source:
ArgumentValidation.cs

Configures the argument to accept only the specified values using the specified comparer, and to suggest them as command line completions.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::CommandLine::Argument<T> ^ AcceptOnlyFromAmong(System::CommandLine::Argument<T> ^ argument, StringComparer ^ comparer, ... cli::array <System::String ^> ^ values);
public static System.CommandLine.Argument<T> AcceptOnlyFromAmong<T>(this System.CommandLine.Argument<T> argument, StringComparer comparer, params string[] values);
static member AcceptOnlyFromAmong : System.CommandLine.Argument<'T> * StringComparer * string[] -> System.CommandLine.Argument<'T>
<Extension()>
Public Function AcceptOnlyFromAmong(Of T) (argument As Argument(Of T), comparer As StringComparer, ParamArray values As String()) As Argument(Of T)

Type Parameters

T

Parameters

argument
Argument<T>

The argument to configure.

comparer
StringComparer

The comparer used to match argument values against the allowed values.

values
String[]

The values that are allowed for the argument.

Returns

Applies to