From 2f4e7422ca0dfb736cc4ba55db5141593e40719c Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Sun, 3 Dec 2017 23:36:19 -0500 Subject: [PATCH] List known repository ids in the info command --- duplicacy/duplicacy_main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/duplicacy/duplicacy_main.go b/duplicacy/duplicacy_main.go index 524884c..9d9f019 100644 --- a/duplicacy/duplicacy_main.go +++ b/duplicacy/duplicacy_main.go @@ -1170,6 +1170,19 @@ func infoStorage(context *cli.Context) { } else { config.Print() } + + dirs, _, err := storage.ListFiles(0, "snapshots/") + if err != nil { + duplicacy.LOG_ERROR("STORAGE_LIST", "Failed to list repository ids: %v", err) + return + } + + for _, dir := range dirs { + if len(dir) > 0 && dir[len(dir)-1] == '/' { + duplicacy.LOG_INFO("STORAGE_SNAPSHOT", "%s", dir[0:len(dir) - 1]) + } + } + } func main() {