Print errors with a different format for easier clickability (fixes #532)

This commit is contained in:
Matthias 2022-03-01 16:58:04 +01:00 committed by GitHub
parent d7de8ad38e
commit 0fc5fc9ffe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -276,7 +276,7 @@ mod cli {
.assert()
.failure()
.code(2)
.stdout(contains("https://github.com/mre/idiomatic-rust-doesnt-exist-man: \
.stdout(contains("https://github.com/mre/idiomatic-rust-doesnt-exist-man | \
GitHub token not specified. To check GitHub links reliably, use `--github-token` flag / `GITHUB_TOKEN` env var."));
}

View file

@ -72,7 +72,9 @@ impl Display for ResponseBody {
}
// Add a separator between the URI and the additional details below.
write!(f, ": ")?;
// Note: To make the links clickable in some terminals,
// we add a space before the separator.
write!(f, " | ")?;
match &self.status {
Status::Ok(code) => write!(f, "{}", code.canonical_reason().unwrap_or("OK")),