CommandLineParser.Parse Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
| Nom | Description |
|---|---|
| Parse(Command, IReadOnlyList<String>, ParserConfiguration) |
Analyse une liste d’arguments. |
| Parse(Command, String, ParserConfiguration) |
Analyse une chaîne de ligne de commande. |
Parse(Command, IReadOnlyList<String>, ParserConfiguration)
- Source:
- CommandLineParser.cs
- Source:
- CommandLineParser.cs
Analyse une liste d’arguments.
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
Paramètres
- command
- Command
Commande à utiliser pour analyser l’entrée de ligne de commande.
- args
- IReadOnlyList<String>
Tableau de chaînes généralement passé à la méthode d’un Main programme.
- configuration
- ParserConfiguration
Configuration sur laquelle la grammaire et les comportements de l’analyseur sont basés.
Retours
Informations ParseResult détaillées sur l’opération d’analyse.
S’applique à
Parse(Command, String, ParserConfiguration)
- Source:
- CommandLineParser.cs
- Source:
- CommandLineParser.cs
Analyse une chaîne de ligne de commande.
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
Paramètres
- command
- Command
Commande à utiliser pour analyser l’entrée de ligne de commande.
- commandLine
- String
Entrée de ligne de commande complète avant le fractionnement et la tokenisation. Cette entrée n’est généralement pas disponible lorsque l’analyseur est appelé à partir de Program.Main. Il est principalement utilisé lors du calcul des achèvements via l’outil dotnet-suggest .
- configuration
- ParserConfiguration
Configuration sur laquelle la grammaire et les comportements de l’analyseur sont basés.
Retours
Informations ParseResult détaillées sur l’opération d’analyse.
Remarques
L’entrée de chaîne de ligne de commande est divisée en jetons comme si elle avait été transmise sur la ligne de commande.