Building interactive command-line applications
As you may have noticed – and I’m sure that you did 😉 – we’ve already created some helper methods to display text in different colors for different scenarios: green for success messages, yellow for warnings, and red for errors. The code for these helper methods can be found in the Helper.cs
file.
We could certainly add more methods to this file to support other features, such as progress bars and drop-down lists. However, as I mentioned earlier, I trust that you’re smart, so you won’t want to reinvent the wheel and rather rely on an existing library that fits the job 😊.
Although multiple libraries may exist to fit this purpose, the one we’ll be using in this chapter is Spectre.Console
.
The Spectre.Console
library is designed to enhance the creation of visually appealing console applications by going way beyond colored text. It also allows you to render trees, drop...