-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Anrijs Vitolins edited this page Jan 28, 2022
·
4 revisions
Console tools are quick way to have something done, which is not a regular thing to do. Unfortunately the possibilities of console application and default Visual Studio template leaves space for may improvements, which are covered in this console extensions package.
To use commands and parameter parsing/mapping to command properties, package expects console application to be created as hosted application, using dependency injection and other possibilities usually available by default in ASP.NET applications. This includes logging availability and configuration file usage, too.
- Creating console commands as separate classes based on provided interface:
- Necessary command parameter wiring via attribute use on command class properties (read/mapped from command line or from configuration file).
- Automated validation of parameters and their presence (if mandatory).
- Automated command(s) on-screen help generation.
- One (default to run) or multiple command (specify in command line) possibility.
-
Output helpers (with colors!):
- Simple output coloring (both foreground and background colors).
- Interpolated string bi-coloring.
- Clear line, overwrite line.
- Setting predefined color scheme from 4 available in package.
- Simple menu.
-
Busy indicator (spinner) for long process visualization (does not block working thread).
- Working status messages along with spinner.
- Elapsed time display for process.
- Inline Progress bar.
-
Progress bar
- Based on currentStep/totalSteps.
- Shows execution time along with percents.
-
Input helpers:
- Password input (entered characters replaced with asterisk (*) on screen).
- Wait for specific keys.
- Wait for Enter; Wait for Escape.
- Wait for y/n.