From 9776a13e33bc371a67f0d44925e2bf04dca159f1 Mon Sep 17 00:00:00 2001 From: muddlebee Date: Wed, 10 Jul 2024 04:27:00 +0530 Subject: fix: panic when piping "deno help" or "deno --version" (#22917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #22863 --------- Co-authored-by: Bartek IwaƄczuk --- cli/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/main.rs b/cli/main.rs index 3368a06fc..8ae83e735 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -347,7 +347,8 @@ fn resolve_flags_and_init( if err.kind() == clap::error::ErrorKind::DisplayHelp || err.kind() == clap::error::ErrorKind::DisplayVersion => { - err.print().unwrap(); + // Ignore results to avoid BrokenPipe errors. + let _ = err.print(); std::process::exit(0); } Err(err) => exit_for_error(AnyError::from(err)), -- cgit v1.2.3