Прочитать на английском Изменить

Поделиться через


ArgumentExtensions.ExistingOnly Method

Definition

Overloads

ExistingOnly(Argument<DirectoryInfo>)

Configures an argument to accept only values corresponding to an existing directory.

ExistingOnly(Argument<FileInfo>)

Configures an argument to accept only values corresponding to an existing file.

ExistingOnly(Argument<FileSystemInfo>)

Configures an argument to accept only values corresponding to an existing file or directory.

ExistingOnly<T>(Argument<T>)

Configures an argument to accept only values corresponding to a existing files or directories.

ExistingOnly(Argument<DirectoryInfo>)

Source:
ArgumentExtensions.cs

Configures an argument to accept only values corresponding to an existing directory.

public static System.CommandLine.Argument<System.IO.DirectoryInfo> ExistingOnly(this System.CommandLine.Argument<System.IO.DirectoryInfo> argument);

Parameters

argument
Argument<DirectoryInfo>

The argument to configure.

Returns

The configured argument.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

ExistingOnly(Argument<FileInfo>)

Source:
ArgumentExtensions.cs

Configures an argument to accept only values corresponding to an existing file.

public static System.CommandLine.Argument<System.IO.FileInfo> ExistingOnly(this System.CommandLine.Argument<System.IO.FileInfo> argument);

Parameters

argument
Argument<FileInfo>

The argument to configure.

Returns

The configured argument.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

ExistingOnly(Argument<FileSystemInfo>)

Source:
ArgumentExtensions.cs

Configures an argument to accept only values corresponding to an existing file or directory.

public static System.CommandLine.Argument<System.IO.FileSystemInfo> ExistingOnly(this System.CommandLine.Argument<System.IO.FileSystemInfo> argument);

Parameters

argument
Argument<FileSystemInfo>

The argument to configure.

Returns

The configured argument.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

ExistingOnly<T>(Argument<T>)

Source:
ArgumentExtensions.cs

Configures an argument to accept only values corresponding to a existing files or directories.

public static System.CommandLine.Argument<T> ExistingOnly<T>(this System.CommandLine.Argument<T> argument) where T : System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo>;

Type Parameters

T

Parameters

argument
Argument<T>

The argument to configure.

Returns

The configured argument.

Applies to

.NET 10 (package-provided) и другие версии
Продукт Версии
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)