Add additional information about sync status to hishtory status -v for debugging purposes

This commit is contained in:
David Dworken 2023-09-07 18:10:17 -07:00
parent c73b10011b
commit 4bc23c9575
No known key found for this signature in database

View File

@ -23,11 +23,25 @@ var statusCmd = &cobra.Command{
fmt.Printf("User ID: %s\n", data.UserId(config.UserSecret))
fmt.Printf("Device ID: %s\n", config.DeviceId)
printDumpStatus(config)
printOnlineStatus(config)
}
fmt.Printf("Commit Hash: %s\n", lib.GitCommit)
},
}
func printOnlineStatus(config hctx.ClientConfig) {
if config.IsOffline {
fmt.Println("Sync Mode: Disabled")
} else {
fmt.Println("Sync Mode: Enabled")
if config.HaveMissedUploads {
fmt.Println("Sync Status: Unsynced (device is offline?)")
} else {
fmt.Println("Sync Status: Synced")
}
}
}
func printDumpStatus(config hctx.ClientConfig) {
dumpRequests, err := lib.GetDumpRequests(config)
lib.CheckFatalError(err)