From 9f9949358347d4e99947c1be8b5a2879b57f8bd8 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Fri, 13 Sep 2024 15:43:36 -0700 Subject: [PATCH] capture errors from cmd/root Signed-off-by: Kit Patella --- src/cmd/root.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cmd/root.go b/src/cmd/root.go index 62e0582c8e..c6fe7a479f 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -71,8 +71,11 @@ var rootCmd = &cobra.Command{ SilenceErrors: true, Run: func(cmd *cobra.Command, args []string) { zarfLogo := message.GetLogo() - _, _ = fmt.Fprintln(os.Stderr, zarfLogo) - cmd.Help() + _, _ = fmt.Fprintln(os.Stderr, zarfLogo) //nolint:errcheck + err := cmd.Help() + if err != nil { + _, _ = fmt.Fprintln(os.Stderr, err) //nolint:errcheck + } if len(args) > 0 { if strings.Contains(args[0], config.ZarfPackagePrefix) || strings.Contains(args[0], "zarf-init") {