From 8bd463288f4b289e71e5a4bbd5d0e89f05995c4c Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Tue, 5 Dec 2017 13:42:17 -0500 Subject: [PATCH] Add a -storage-name option to specify the name of the storage to be initialized --- duplicacy/duplicacy_main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/duplicacy/duplicacy_main.go b/duplicacy/duplicacy_main.go index 9d9f019..c87b711 100644 --- a/duplicacy/duplicacy_main.go +++ b/duplicacy/duplicacy_main.go @@ -216,7 +216,10 @@ func configRepository(context *cli.Context, init bool) { var storageURL string if init { - storageName = "default" + storageName = context.String("storage-name") + if len(storageName) == 0 { + storageName = "default" + } snapshotID = context.Args()[0] storageURL = context.Args()[1] } else { @@ -1225,6 +1228,11 @@ func main() { Usage: "alternate location for the .duplicacy directory (absolute or relative to current directory)", Argument: "", }, + cli.StringFlag{ + Name: "storage-name", + Usage: "assign a name to the storage", + Argument: "", + }, }, Usage: "Initialize the storage if necessary and the current directory as the repository", ArgsUsage: " ",