mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
263 stars 30 forks source link

`cli` as "suggested" dependency? #220

Closed matthiasgomolka closed 2 years ago

matthiasgomolka commented 2 years ago

Hi,

first of all, thanks for creating an maintaining checkmate! I use it in all my packages.

But recently, I've discovered the cli package which makes is super easy to create better / more readable messages and errors.

Would it be possible to make cli a "suggested" dependecy and, if it's installed, use it's capacities to throw errors and messages?

mllg commented 2 years ago

I like the cli package, but I don't think that checkmate should throw different error messages depending on whether a suggested package is installed or not. The error messages should already be highlighted in most GUIs/terminals (usually red) as they are exceptions. Using multiple hard-coded colors is also not feasible, e.g. they might not be readable on both dark and light backgrounds.

Probably the most important point for me: if the output is redirected, e.g. into a log file, the ANSI escape codes often render searching for strings impossible.