Designing user-friendly CLI applications
Although tons of features are provided by Spectre.Console
(and I encourage you to check them out by visiting the documentation at https://spectreconsole.net), we’ll be focusing on a subset of these capabilities to add more interactivity to our Bookmarkr application.
Enhancing text display using markup
Let’s improve our Helper.cs
class by leveraging the markup capabilities provided by Spectre.Console
. These capabilities allow us to style and format text and even render emojis! However, note that some terminal environments (especially older systems or restricted environments, such as CI/CD systems) might not support emoji rendering.
First, let’s review our three methods: ShowErrorMessage
, ShowWarningMessage
, and ShowSuccessMessage
.
These methods differ in the color in which they display the text that’s received as a parameter, but they’re similar in the way that they all follow the same process:
...