From 81e54f744407d3d2e647c6e0b36fb45d8c200b16 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 188f91e8cc..3c9f9bac4d 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -77,8 +77,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") {