Skip to content

Commit df8f09e

Browse files
committed
zsd: fix for the new api
1 parent 0fa8c8f commit df8f09e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/zsd/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535
fmt.Fprintf(os.Stderr, "\nACTIONS:\n")
3636
fmt.Fprintf(os.Stderr, " list : list zfs snapshots where the given file was modified\n")
3737
fmt.Fprintf(os.Stderr, " cat <#|SNAPSHOT>: show the file content from the given snapshot\n")
38-
fmt.Fprintf(os.Stderr, " diff <#|SNAPSHOT>: show a diff from the selected snapshot to the actual version\n")
38+
fmt.Fprintf(os.Stderr, " diff <#|SNAPSHOT>: show a diff from the selected snapshot to the current version\n")
3939
fmt.Fprintf(os.Stderr, " restore <#|SNAPSHOT>: restore the file from the given snapshot\n")
4040
fmt.Fprintf(os.Stderr, "\nYou can use the snapshot number from the `list` output or the snapshot name to select a snapshot.\n")
4141
fmt.Fprintf(os.Stderr, "\nProject home page: https://j-keck.github.io/zfs-snap-diff\n")
@@ -77,7 +77,7 @@ func main() {
7777
switch action {
7878
case "list":
7979
fmt.Printf("scan the last %d days for other file versions\n", config.Get.DaysToScan)
80-
dr := scanner.NewDateRange(time.Now(), config.Get.DaysToScan)
80+
dr := scanner.NDaysBack(config.Get.DaysToScan, time.Now())
8181
sc := scanner.NewScanner(dr, "auto", ds, zfs)
8282
scanResult, err := sc.FindFileVersions(filePath)
8383
if err != nil {
@@ -164,15 +164,15 @@ func main() {
164164
return
165165
}
166166

167-
backupPath, err := version.Actual.Backup()
167+
backupPath, err := version.Current.Backup()
168168
if err != nil {
169-
log.Errorf("unable to backup the acutal version - %v", err)
169+
log.Errorf("unable to backup the current version - %v", err)
170170
return
171171
}
172172
fmt.Printf("backup from the actual version created at: %s\n", backupPath)
173173

174174
// restore the backup version
175-
version.Backup.Copy(version.Actual.Path)
175+
version.Backup.Copy(version.Current.Path)
176176
fmt.Printf("version restored from snapshot: %s\n", version.Snapshot.Name)
177177

178178
default:
@@ -209,7 +209,7 @@ func lookupRequestedVersion(filePath, versionName string) (*scanner.FileVersion,
209209
}
210210
}
211211

212-
if version.Actual.Path == filePath {
212+
if version.Current.Path == filePath {
213213
return version, nil
214214
} else {
215215
return nil, errors.New("file mismatch - perform a `list` action at first")

0 commit comments

Comments
 (0)