commandlineparser / commandlineparser/commandline
How to pass and retain subsequent arguments to a verb with exact format?
- Langage dominant
- C#
- Étoiles
- 4.8k
- Forks
- 478
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I am trying to create a verb that includes all subsequent arguments. I require it to retain the exact format in which it is passed to the verb. My intention is to forward the arguments as a shell command. I have tried the following configuration:
```csharp
[Verb("foreach")]
public readonly struct ForeachVerb
{
[Value(0)]
public IEnumerable Command { get; set; }
}
```
But unfortunately, I am encountering errors indicating that options `f`, `foo`, and `bar` are missing for this test argument:
foreach foo bar baz -f true --foo --bar 1
As a workaround, I can fall back to the original `args`, but I am curious if there is any chance to utilize the capabilities that `CommandLineParser` offers. Does anyone have an idea on how to configure `CommandLineParser` to achieve this?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par examiner comment CommandLineParser lie les membres [Verb] et [Value] lorsque les tokens suivants ressemblent à des options. Reproduisez l’exemple `foreach foo bar baz -f true --foo --bar 1` et comparez le comportement du parser avec la transmission des args d’origine. La tâche est terminée lorsqu’il est déterminé si la préservation exacte des arguments est prise en charge et que la configuration appropriée est documentée ou implémentée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp
- Domaine
- cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100