dotnet / dotnet/command-line-api
add support for either/or type binding for arguments
- Lingua principale
- C#
- Stelle
- 3.7k
- Fork
- 428
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
A common use case is that a given argument should be constrained to be parseable as either `DirectoryInfo` or `FileInfo`. There should be an API that makes this simple to express, performs input validation as expected, and binds the result correctly to a handler parameter.
While in this example a common base type (`FileSystemInfo`) could be passed to the handler, a related question is whether this should be a constraint. If a common base type is not required, the implication is that the type to which the argument is bound at runtime would drive overload resolution between different handlers, although this would add a lot of complexity and is probably not the best direction.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
L’issue non indica file, test o punti di ingresso. Inizia individuando le API esistenti per il binding degli argomenti e la convalida degli input, quindi esamina i test correlati e il comportamento dei parametri dell’handler. Il lavoro è completo quando viene definita un’API per il binding di una delle due opzioni, viene convalidato l’input, il risultato viene associato correttamente e viene stabilito se è necessario un tipo base comune.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100