commandlineparser / commandlineparser/commandline
Can I add validate feature in Set parameter, and throw exception, and show usage?
- Lenguaje dominante
- C#
- Estrellas
- 4.8k
- Forks
- 478
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Can I add validate feature in Set parameter, and throw exception, and show usage?
is there exception handling in command line parameter parsing?
[Option(
'f', "filename",
HelpDesk = "Specifies the input file")]
public string Name
{
get { return mName; }
set
{
Regex regex = new Regex("^[0-9a-z]+.txt$");
if (regex.Match(value).Success )
throw new InvalidOptionValueException(
"The name must be txt file", false);
mName = value;
}
}
Private string mName;
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.