diff --git a/cli/command_storage_list.go b/cli/command_storage_list.go index 895fd0f7c..59c6088cc 100644 --- a/cli/command_storage_list.go +++ b/cli/command_storage_list.go @@ -10,6 +10,8 @@ import ( var ( storageListCommand = storageCommands.Command("list", "List storage blocks").Alias("ls") storageListPrefix = storageListCommand.Flag("prefix", "Block prefix").String() + storageListMinSize = storageListCommand.Flag("min-size", "Minimum size").Int64() + storageListMaxSize = storageListCommand.Flag("max-size", "Maximum size").Int64() ) func runListStorageBlocks(ctx context.Context, rep *repo.Repository) error { @@ -22,6 +24,14 @@ func runListStorageBlocks(ctx context.Context, rep *repo.Repository) error { return b.Error } + if *storageListMaxSize != 0 && b.Length > *storageListMaxSize { + continue + } + + if *storageListMinSize != 0 && b.Length < *storageListMinSize { + continue + } + fmt.Printf("%-70v %10v %v\n", b.BlockID, b.Length, b.TimeStamp.Local().Format(timeFormat)) }