Skip to content

Commit

Permalink
Fixed error message format for list command
Browse files Browse the repository at this point in the history
  • Loading branch information
davidallendj committed Aug 8, 2024
1 parent 39ad0d7 commit 3d6daa7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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" {
Expand All @@ -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)
}

0 comments on commit 3d6daa7

Please sign in to comment.