More coherent behaviour for the init command

init

#1

The init command is an ambiguous animal because it initializes both the storage and the repository, even when the storage has already been initialized. Probably the most coherent way of putting this is to say that it initializes the connection between the repository and the storage.

In any case, this means that when you want to initialize a repository (for example, if you want to restore to a particular folder rather than to the original file location) with an existing storage, you don’t really need to tell duplicacy anything about the storage (except it’s path, of course). All duplicacy needs is the name of the repository, right?

Indeed, this is how duplicacy currently works for all storage related init opions except for -e (or -exncrypt). If a storage is encrypted you still need to tell duplicacy that it is encrypted because if you don’t then:

PS D:\restore> duplicacy init NAS webdav://<myusername>@webdav.pcloud.com/Backup/Duplicacy
Enter the WebDAV password:*********************************
Failed to download the configuration file from the storage: The storage is likely to have been initialized with a password before

As an aside, the error message is somewhat inaccurate because I’m sure duplicacy was able to download the file. It just couldn’t make any sense of its contents.

But my main point here is: wouldn’t it make sense to allow users to omit also the -e option and prompt for the storage password rather than cryptically hinting the user that the storage might be encrypted?