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

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


OptionExtensions.Parse Method

Definition

Overloads

Parse(Option, String)

Parses a command line string value using an option.

Parse(Option, String[])

Parses a command line string value using an option.

Parse(Option, String)

Source:
OptionExtensions.cs

Parses a command line string value using an option.

C#
public static System.CommandLine.Parsing.ParseResult Parse(this System.CommandLine.Option option, string commandLine);

Parameters

option
Option

The option to use to parse the command line input.

commandLine
String

A command line string to parse, which can include spaces and quotes equivalent to what can be entered into a terminal.

Returns

A parse result describing the outcome of the parse operation.

Remarks

The command line string input will be split into tokens as if it had been passed on the command line.

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)

Parse(Option, String[])

Source:
OptionExtensions.cs

Parses a command line string value using an option.

C#
public static System.CommandLine.Parsing.ParseResult Parse(this System.CommandLine.Option option, string[] args);

Parameters

option
Option

The option to use to parse the command line input.

args
String[]

The string options to parse.

Returns

A parse result describing the outcome of the parse operation.

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)