eyre-rs / color-eyre

Custom hooks for colorful human oriented error reports via panics and the eyre crate
Other
958 stars 57 forks source link

Omit numbering of errors if there's only one #138

Open ivan-aksamentov opened 11 months ago

ivan-aksamentov commented 11 months ago

Currently the numbering of the list of errors is shown even if there is only one error:

Error:
   0: There is only one error

Location:
...

I propose to remove the numbering in this case, because some of our users are confused by this 0: somehow. Some think that it's an erroneous file name or even line number (i.e. if a file parsing error is reported) or an error code.

The numbering of the error messages is not something that's common in other CLI frameworks.

ten3roberts commented 11 months ago

Would you also like if we made the error numbering configurable too, such that it can be entirely removed or replaced with a dash-style list?

- Error message
- Other error message
monkeydom commented 2 months ago

+1 here. I'd like to use color-eyre in user facing tools. However, the great dev features don't provide for a good user experience where I would like it to just show the first error and all sections and suggestions. Happy to whip up a patch here if it is appreciated.