added better error messages inspired by rustc/cargo

but not as good
This commit is contained in:
Mark
2023-10-23 21:48:15 +02:00
parent 62ed8fc2bd
commit ea95a16c30
30 changed files with 557 additions and 260 deletions

27
mers/Cargo.lock generated
View File

@@ -110,6 +110,17 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "colored"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
dependencies = [
"is-terminal",
"lazy_static",
"windows-sys",
]
[[package]]
name = "errno"
version = "0.3.1"
@@ -154,12 +165,24 @@ dependencies = [
"windows-sys",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.147"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
[[package]]
name = "line-span"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29fc123b2f6600099ca18248f69e3ee02b09c4188c0d98e9a690d90dec3e408a"
[[package]]
name = "linux-raw-sys"
version = "0.4.3"
@@ -177,6 +200,10 @@ dependencies = [
[[package]]
name = "mers_lib"
version = "0.3.0"
dependencies = [
"colored",
"line-span",
]
[[package]]
name = "once_cell"

View File

@@ -88,7 +88,7 @@ fn main() {
let return_type = match run.check(&mut info_check, None) {
Ok(v) => v,
Err(e) => {
eprintln!("check failed: {e}");
eprint!("{}", e.display(&source));
std::process::exit(36);
}
};