1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

Add a -storage-name option to specify the name of the storage to be initialized

This commit is contained in:
Gilbert Chen
2017-12-05 13:42:17 -05:00
parent 2f4e7422ca
commit 8bd463288f

View File

@@ -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: "<path>",
},
cli.StringFlag{
Name: "storage-name",
Usage: "assign a name to the storage",
Argument: "<name>",
},
},
Usage: "Initialize the storage if necessary and the current directory as the repository",
ArgsUsage: "<snapshot id> <storage url>",