A collection of common interactive command line user interfaces in C#.
You can find some examples in the samples project.
- Basic Input
- Numeric Input
- Confirmation Input
- List Input
- Password Input
You can set your own valid using the SetValid
method in the input. It receives an object that must implement the IValidator
interface.
var numbersOnly = new RegexValidator("^[0-9]*$");
ageInput.SetValid(numbersOnly);
We already have some validators that you can use:
- RegexValidator
- NumericValidator
- CreditCardNumberValidator
- EmailValidator
- DateValidator
But feel free to implement yours or contribute with more validators 😉
Go to folder src
and run:
dotnet test
This project is licensed under the MIT License - see the LICENSE file for details
Inpired by SBoundrias/Inquirer.js