Open mssun opened 6 years ago
The original plan was for the format to be utilname: error: msg
in most cases, but I've started to think the error:
bit wastes too much space (as with most of these utilities almost any message written to stderr
is an error).
I'm not entirely sure what you mean by "nested together" unless you are referring to Invalid value for '--bytes <NUMBER>': '-' is not a number or is too large
, which I believe is a result of clap
. I also think the GNU and BusyBox errors messages are not clear unless you already understand how the utility works.
For the first question:
utilname: error: msg
error: msg
utilname: msg
I'm not sure which one is better. Seems that Rust's tradition tends to use the second one and "error" is highlighted in red.
For the second question, I mean the error message is in one line and separated in colon. E.g., the current one is:
utilname: error: msg: sub-msg
It looks a little wired (probably because of the prefix utilname: error
). Yes, the current message of GNU and BusyBox is not clear, and I was not suggesting to be consistent with them.
cargo
uses the same format:
$ cargo build -j abc
error: Invalid value: could not parse `abc` as a number
I think we need to keep everything as one line, so the best way to fix this I guess would be to remove the error:
part.
Ok, agree.
BTW, I'm coming up this issue when writing testcases for errors.
The current error messages are not consistent and nested together. We should have a better error message format.
mesabox head:
mesabox cat:
Some examples for reference:
GNU coreutils:
BSD (OS X):
BusyBox:
Cargo: