Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using idiomatic Rust errors #2294

Closed
sharpvik opened this issue Jan 17, 2021 · 3 comments
Closed

Consider using idiomatic Rust errors #2294

sharpvik opened this issue Jan 17, 2021 · 3 comments

Comments

@sharpvik
Copy link

Describe your use case

Currently, the errors look like this:

clap

With the colon in error: being red just like the error label itself. However, the idiomatic Rust compiler errors look like this:

idioma

Describe the solution you'd like

It is a very minor thing, but it causes stylistic incoherence in projects that adhere to the idiomatic error style. Particularly, a few of my projects. (As you can see, I am a perfectionist... I know, sorry.) It would be great if this thing got fixed. There are libraries out there that could potentially make it easier (e.g. idioma)

@ldm0
Copy link
Member

ldm0 commented Jan 17, 2021

Feel free to send a PR as this is only a minor stylistic incoherence.

@pksunkara
Copy link
Member

Yes, it is stylistic, but I would still like the see others reasons for it. "Rust does it" is not good enough because rust is not primarily CLI tool.

Is there research into famous CLI parsers from other languages and how they print the error messages when color is turned on? If there's a convention there, we will follow.

@sharpvik
Copy link
Author

Is there research into famous CLI parsers from other languages and how they print the error messages when color is turned on? If there's a convent

@pksunkara it looks like colorized out is not a widely supported function. Argparse and the like don't support it out of the box. So it looks like you can decide how exactly you want to colorize the output of Clap since you are the authors.

I just think that Rust's errors look very nice and why not follow that convention out of all others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants