From 3d6daa757a3a1487c6ea59421d09f8900923e5e9 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 7 Aug 2024 19:20:11 -0600 Subject: [PATCH] Fixed error message format for list command --- cmd/list.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index 8d788d2..26cc1fc 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -9,7 +9,6 @@ import ( "github.com/OpenCHAMI/magellan/internal/cache/sqlite" "github.com/rs/zerolog/log" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -27,7 +26,7 @@ var listCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { scannedResults, err := sqlite.GetScannedAssets(cachePath) if err != nil { - logrus.Errorf("failed to get scanned assets: %v\n", err) + log.Error().Err(err).Msg("failed to get scanned assets") } format = strings.ToLower(format) if format == "json" { @@ -45,6 +44,6 @@ var listCmd = &cobra.Command{ } func init() { - listCmd.Flags().StringVar(&format, "format", "", "set the output format") + listCmd.Flags().StringVar(&format, "format", "", "set the output format (json|default)") rootCmd.AddCommand(listCmd) }