summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authormuddlebee <anweshknayak@gmail.com>2024-07-10 04:27:00 +0530
committerGitHub <noreply@github.com>2024-07-09 22:57:00 +0000
commit9776a13e33bc371a67f0d44925e2bf04dca159f1 (patch)
tree6419d25d2f51affe271018c7b55e1cf66641506b /cli/main.rs
parentfb6348500ffc827b3aaca3e8299e1a3964be43c1 (diff)
fix: panic when piping "deno help" or "deno --version" (#22917)
Fixes #22863 --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs3
1 files changed, 2 insertions, 1 deletions
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)),