Improve error messages to avoid arrow ligature
This is the output I got when running bat cache without either required option (--build or --clear):
The beginning of <--build|--clear> gets turned into a <-- ligature.
Maybe the error messages could be improved to avoid this?
I'm interested in this one - I saw the good first issue label 😄
I’ve started looking through the code, and it seems like the usage line is generated by clap, not written directly by bat. I’ll dig a bit deeper if we can change the style by some options.
Ah sorry if it doesn't turn out to be so easy, I confess that I added the label without checking, I just assumed we had <--build hardcoded somewhere
You're welcome! It still seems easy if the <--option_name> format is hard-coded in clap and customizable, then it should be an easy fix. If not, it might take a bit more work, but let’s see :)
I took a look inside clap, and it seems we can't easily change the < and > markers. We could use override_usage to work around this, but I don't think that's a great solution since we'd have to give up clap's smart usage generation. 😭
Thanks for looking @minty99, that indeed doesn't seem like an approach we would want to take. Maybe it's worth logging an issue on clap's repo @injust if there isn't one already.
I'm not sure if this is a clap issue tbh. It's pretty conventional to represent required parts of a command with <...>.
I suspect I haven't seen this happen in other programs because mandatory options are a bit strange and I see subcommands used a lot more, e.g. uv cache prune.
I also came across https://github.com/sharkdp/bat/issues/1726, which has relevant discussion about the bat cache command being problematic.