CommandLineParser.Parse 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
分析参数列表。
重载
| 名称 | 说明 |
|---|---|
| Parse(IReadOnlyList<String>, String) | |
| Parse(Command, IReadOnlyList<String>, ParserConfiguration) |
分析参数列表。 |
| Parse(Command, String, ParserConfiguration) |
分析命令行字符串。 |
Parse(IReadOnlyList<String>, String)
public override System.CommandLine.ParseResult Parse(System.Collections.Generic.IReadOnlyList<string> arguments, string rawInput = default);
override this.Parse : System.Collections.Generic.IReadOnlyList<string> * string -> System.CommandLine.ParseResult
Public Overrides Function Parse (arguments As IReadOnlyList(Of String), Optional rawInput As String = Nothing) As ParseResult
参数
- arguments
- IReadOnlyList<String>
- rawInput
- String
返回
适用于
Parse(Command, IReadOnlyList<String>, ParserConfiguration)
- Source:
- CommandLineParser.cs
- Source:
- CommandLineParser.cs
分析参数列表。
public static System.CommandLine.ParseResult Parse(System.CommandLine.Command command, System.Collections.Generic.IReadOnlyList<string> args, System.CommandLine.ParserConfiguration? configuration = default);
static member Parse : System.CommandLine.Command * System.Collections.Generic.IReadOnlyList<string> * System.CommandLine.ParserConfiguration -> System.CommandLine.ParseResult
Public Shared Function Parse (command As Command, args As IReadOnlyList(Of String), Optional configuration As ParserConfiguration = Nothing) As ParseResult
参数
- command
- Command
用于分析命令行输入的命令。
- args
- IReadOnlyList<String>
字符串数组通常传递给程序 Main 的方法。
- configuration
- ParserConfiguration
分析器语法和行为所基于的配置。
返回
提供有关 ParseResult 分析操作的详细信息。
适用于
Parse(Command, String, ParserConfiguration)
- Source:
- CommandLineParser.cs
- Source:
- CommandLineParser.cs
分析命令行字符串。
public static System.CommandLine.ParseResult Parse(System.CommandLine.Command command, string commandLine, System.CommandLine.ParserConfiguration? configuration = default);
static member Parse : System.CommandLine.Command * string * System.CommandLine.ParserConfiguration -> System.CommandLine.ParseResult
Public Shared Function Parse (command As Command, commandLine As String, Optional configuration As ParserConfiguration = Nothing) As ParseResult
参数
- command
- Command
用于分析命令行输入的命令。
- commandLine
- String
拆分和标记化之前的完整命令行输入。 从 Program.Main中调用分析器时,此输入通常不可用。 它主要用于通过 dotnet-suggest 工具计算完成时间。
- configuration
- ParserConfiguration
分析器语法和行为所基于的配置。
返回
提供有关 ParseResult 分析操作的详细信息。
注解
命令行字符串输入将拆分为标记,就像在命令行上传递一样。