mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-06 00:03:38 +00:00
Add -storage-name to the info command for reading the correct password
This commit is contained in:
@@ -1196,6 +1196,11 @@ func infoStorage(context *cli.Context) {
|
|||||||
DoNotSavePassword: true,
|
DoNotSavePassword: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storageName := context.String("storage-name")
|
||||||
|
if storageName != "" {
|
||||||
|
preference.Name = storageName
|
||||||
|
}
|
||||||
|
|
||||||
if resetPasswords {
|
if resetPasswords {
|
||||||
// We don't want password entered for the info command to overwrite the saved password for the default storage,
|
// We don't want password entered for the info command to overwrite the saved password for the default storage,
|
||||||
// so we simply assign an empty name.
|
// so we simply assign an empty name.
|
||||||
@@ -1222,7 +1227,7 @@ func infoStorage(context *cli.Context) {
|
|||||||
|
|
||||||
dirs, _, err := storage.ListFiles(0, "snapshots/")
|
dirs, _, err := storage.ListFiles(0, "snapshots/")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
duplicacy.LOG_ERROR("STORAGE_LIST", "Failed to list repository ids: %v", err)
|
duplicacy.LOG_WARN("STORAGE_LIST", "Failed to list repository ids: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1787,6 +1792,11 @@ func main() {
|
|||||||
Usage: "retrieve saved passwords from the specified repository",
|
Usage: "retrieve saved passwords from the specified repository",
|
||||||
Argument: "<repository directory>",
|
Argument: "<repository directory>",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "storage-name",
|
||||||
|
Usage: "the storage name to be assigned to the storage url",
|
||||||
|
Argument: "<name>",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "reset-passwords",
|
Name: "reset-passwords",
|
||||||
Usage: "take passwords from input rather than keychain/keyring",
|
Usage: "take passwords from input rather than keychain/keyring",
|
||||||
|
|||||||
Reference in New Issue
Block a user