CommandLineParser.Parse Methode

Definitie

Overloads

Name Description
Parse(Command, IReadOnlyList<String>, ParserConfiguration)

Parseert een lijst met argumenten.

Parse(Command, String, ParserConfiguration)

Parseert een opdrachtregelreeks.

Parse(Command, IReadOnlyList<String>, ParserConfiguration)

Bron:
CommandLineParser.cs
Bron:
CommandLineParser.cs

Parseert een lijst met argumenten.

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

Parameters

command
Command

De opdracht die moet worden gebruikt om de opdrachtregelinvoer te parseren.

args
IReadOnlyList<String>

De tekenreeksmatrix wordt doorgaans doorgegeven aan de methode van Main een programma.

configuration
ParserConfiguration

De configuratie waarop de grammatica en het gedrag van de parser zijn gebaseerd.

Retouren

Een ParseResult gedetailleerde informatie over de parseringsbewerking.

Van toepassing op

Parse(Command, String, ParserConfiguration)

Bron:
CommandLineParser.cs
Bron:
CommandLineParser.cs

Parseert een opdrachtregelreeks.

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

Parameters

command
Command

De opdracht die moet worden gebruikt om de opdrachtregelinvoer te parseren.

commandLine
String

De volledige opdrachtregelinvoer vóór het splitsen en tokeniseren. Deze invoer is doorgaans niet beschikbaar wanneer de parser wordt aangeroepen.Program.Main Het wordt voornamelijk gebruikt bij het berekenen van voltooiingen via het dotnet-suggest hulpprogramma.

configuration
ParserConfiguration

De configuratie waarop de grammatica en het gedrag van de parser zijn gebaseerd.

Retouren

Een ParseResult gedetailleerde informatie over de parseringsbewerking.

Opmerkingen

De invoer van de opdrachtregelreeks wordt gesplitst in tokens alsof deze zijn doorgegeven op de opdrachtregel.

Van toepassing op