From 0fc5fc9ffedee9bc0fad75912242e06da66736d7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 1 Mar 2022 16:58:04 +0100 Subject: [PATCH] Print errors with a different format for easier clickability (fixes #532) --- lychee-bin/tests/cli.rs | 2 +- lychee-lib/src/types/response.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lychee-bin/tests/cli.rs b/lychee-bin/tests/cli.rs index f679720..68caf26 100644 --- a/lychee-bin/tests/cli.rs +++ b/lychee-bin/tests/cli.rs @@ -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.")); } diff --git a/lychee-lib/src/types/response.rs b/lychee-lib/src/types/response.rs index ae14e70..4aba751 100644 --- a/lychee-lib/src/types/response.rs +++ b/lychee-lib/src/types/response.rs @@ -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")),