From 590311c482423400a88dd1b4dd3d888ab54dee25 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 19 Dec 2024 14:24:51 +0100 Subject: [PATCH] updates --- client/snapshot/list.go | 5 +++++ server/v2/store/snapshot.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/client/snapshot/list.go b/client/snapshot/list.go index 43ff31cfd4ac..1d564c44f5cc 100644 --- a/client/snapshot/list.go +++ b/client/snapshot/list.go @@ -23,6 +23,11 @@ var ListSnapshotsCmd = &cobra.Command{ if err != nil { return fmt.Errorf("failed to list snapshots: %w", err) } + + if len(snapshots) == 0 { + cmd.Println("no snapshots found") + } + for _, snapshot := range snapshots { cmd.Println("height:", snapshot.Height, "format:", snapshot.Format, "chunks:", snapshot.Chunks) } diff --git a/server/v2/store/snapshot.go b/server/v2/store/snapshot.go index c9e8c308c272..0fa2b67c708e 100644 --- a/server/v2/store/snapshot.go +++ b/server/v2/store/snapshot.go @@ -127,6 +127,11 @@ func (s *Server[T]) ListSnapshotsCmd() *cobra.Command { if err != nil { return fmt.Errorf("failed to list snapshots: %w", err) } + + if len(snapshots) == 0 { + cmd.Println("no snapshots found") + } + for _, snapshot := range snapshots { cmd.Println("height:", snapshot.Height, "format:", snapshot.Format, "chunks:", snapshot.Chunks) }