From 91359306aae0d03e7e7c46f2f201f85c1b961393 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 26 Mar 2020 04:44:29 -0600 Subject: [PATCH] make operations mutually exclusive --- .vscode/numbered-bookmarks.json | 2 +- borghelper.sh | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 388c3b4..e6b9404 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -4,7 +4,7 @@ "fsPath": "$ROOTPATH$/borghelper.sh", "bookmarks": [ -1, - 257, + 253, 151, -1, -1, diff --git a/borghelper.sh b/borghelper.sh index 1f070a1..acaaac3 100755 --- a/borghelper.sh +++ b/borghelper.sh @@ -246,17 +246,13 @@ export TMPDIR="${borgBaseDir}/tmp" # info operations if [ "$operation" = 'info' ]; then borg info ::"${archiveName}" -fi - # list operations -if [ "$operation" = 'listall' ]; then +elif [ "$operation" = 'listall' ]; then borg list elif [ "$operation" = 'viewarchive' ]; then borg list ::"${archiveName}" -fi - # restore operations -if [ "$operation" = 'restore' ]; then +elif [ "$operation" = 'restore' ]; then if [ -z "$fileName" ]; then # restore entire archive cd "$restorePath" || consoleError 4 'Could not change to restore directory.'