From 42f61ebf8ac560dbfb356fd276494ced58ce7dc8 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 2 Mar 2022 03:07:28 -0800 Subject: cleanup error printing --- src/cli.zig | 4 +++- src/install/install.zig | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cli.zig b/src/cli.zig index 152661eff..d6c83d3ce 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -308,8 +308,10 @@ pub const Arguments = struct { .allocator = allocator, }) catch |err| { // Report useful error and exit + clap.help(Output.errorWriter(), ¶ms) catch {}; + Output.errorWriter().writeAll("\n") catch {}; diag.report(Output.errorWriter(), err) catch {}; - return err; + Global.exit(1); }; if (args.flag("--version")) { diff --git a/src/install/install.zig b/src/install/install.zig index 842a44b40..ea555eb5d 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -3401,7 +3401,8 @@ pub const PackageManager = struct { .diagnostic = &diag, .allocator = allocator, }) catch |err| { - // Report useful error and exit + clap.help(Output.errorWriter(), params) catch {}; + Output.errorWriter().writeAll("\n") catch {}; diag.report(Output.errorWriter(), err) catch {}; return err; }; -- cgit v1.2.3