Enforce that --source-dir can only be specified once

This commit is contained in:
Mike 2019-08-05 03:20:45 -07:00
parent 9d66f59113
commit b979b6196f

View File

@ -154,6 +154,8 @@ class MikesBackup:
a = a + 1 a = a + 1
elif arg == "--source-dir": elif arg == "--source-dir":
valid_arg = True valid_arg = True
if self.__source_dir:
raise Exception("--source-dir can only be used once")
self.__source_dir = sys.argv[a + 1] self.__source_dir = sys.argv[a + 1]
self.log("Found source dir: " + sys.argv[a + 1]) self.log("Found source dir: " + sys.argv[a + 1])
a = a + 1 a = a + 1