mirror of
https://github.com/kopia/kopia.git
synced 2026-10-22 06:04:47 -04:00
added new cli flags to 'storage list'
This commit is contained in:
1 parent
5ba913380e
commit
02c5e90671
1 file changed
+10
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user