diff --git a/pkg/kopia/command/snapshot.go b/pkg/kopia/command/snapshot.go index 2362b9d0b2..2bd4f15cf1 100644 --- a/pkg/kopia/command/snapshot.go +++ b/pkg/kopia/command/snapshot.go @@ -176,6 +176,7 @@ type SnapshotVerifyCommandArgs struct { DirectoryID []string FileID []string Sources []string + SnapshotIDs []string VerifyFilesPercent *float64 Parallelism *int FileQueueLength *int @@ -217,5 +218,9 @@ func SnapshotVerify(cmdArgs SnapshotVerifyCommandArgs) []string { args = args.AppendLoggableKV(sourcesFlag, source) } + for _, snapID := range cmdArgs.SnapshotIDs { + args = args.AppendLoggable(snapID) + } + return stringSliceCommand(args) } diff --git a/pkg/kopia/command/snapshot_test.go b/pkg/kopia/command/snapshot_test.go index f32385c656..3db50cc8b2 100644 --- a/pkg/kopia/command/snapshot_test.go +++ b/pkg/kopia/command/snapshot_test.go @@ -171,10 +171,11 @@ func (kSnapshot *KopiaSnapshotTestSuite) TestSnapshotCommands(c *C) { DirectoryID: []string{"d1", "d2"}, FileID: []string{"f1", "f2"}, Sources: []string{"s1", "s2"}, + SnapshotIDs: []string{"id1", "id2"}, } return SnapshotVerify(args) }, - expectedLog: "kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log --password=encr-key snapshot verify --verify-files-percent=12.345 --parallel=123 --file-queue-length=456 --file-parallelism=890 --directory-id=d1 --directory-id=d2 --file-id=f1 --file-id=f2 --sources=s1 --sources=s2", + expectedLog: "kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log --password=encr-key snapshot verify --verify-files-percent=12.345 --parallel=123 --file-queue-length=456 --file-parallelism=890 --directory-id=d1 --directory-id=d2 --file-id=f1 --file-id=f2 --sources=s1 --sources=s2 id1 id2", }, } { cmd := strings.Join(tc.f(), " ")