54f9aaf27acc2964ffb083b7d06435533fc7ce80

Author
Zertrin <zertrin@gmail.com>
Committer
Zertrin <zertrin@gmail.com>
Date

Message

Complete the half-done work of previous commit

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index 0a338ac76ca34f201b85ba93d7b84ba1b9a93096..26dc124eebfd5a30d55c3f9de787ba40e62b518a 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -82,7 +82,7 @@ echo "USAGE:
 6 while getopts ":c:t:bfvlsnd-:" opt; do
 7   case $opt in
 8     # parse long options (a bit tricky because builtin getopts does not
 9-    # manage long options and i don't want to impose GNU getopt dependancy)
10+    # manage long options and I don't want to impose GNU getopt dependancy)
11     -)
12       case "$OPTARG" in
13         # --restore [restore dest]
14@@ -597,16 +597,17 @@ case "$COMMAND" in
15     duplicity_backup
16   ;;
17 
18-  "restore-file")
19+  "restore-file"|"restore-dir")
20     ROOT=$DEST
21-    OPTION=
22+    OPTION="restore"
23 
24     if [ ! -z "$TIME" ]; then
25       STATIC_OPTIONS="$STATIC_OPTIONS --time $TIME"
26     fi
27 
28     if [[ ! "$FILE_TO_RESTORE" ]]; then
29-      echo "Which file do you want to restore (eg, mail/letter.txt):"
30+      echo "Which file or directory do you want to restore?"
31+      echo "(give the path relative to the root of the backup eg, mail/letter.txt):"
32       read -e FILE_TO_RESTORE
33       echo
34     fi
35@@ -633,7 +634,7 @@ case "$COMMAND" in
36 
37     setup_passphrase
38     echo "Restoring now ..."
39-    #use INCLUDE variable without create another one
40+    #use INCLUDE variable without creating another one
41     INCLUDE="--file-to-restore ${FILE_TO_RESTORE}"
42     duplicity_backup
43   ;;