Prevent use of --synchronize & --monitor together (#431)

* Prevent use of --synchronize & --monitor together
This commit is contained in:
abraunegg 2019-03-23 10:20:27 +11:00 committed by GitHub
parent f5c3e7643d
commit 002f9b7aec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -402,7 +402,6 @@ int main(string[] args)
// if --synchronize or --monitor not passed in, exit & display help
auto performSyncOK = false;
if (synchronize || monitor) {
performSyncOK = true;
}
@ -420,6 +419,14 @@ int main(string[] args)
return EXIT_FAILURE;
}
// if --synchronize && --monitor passed in, exit & display help as these conflict with each other
if (synchronize && monitor) {
writeln("\nERROR: --synchronize and --monitor cannot be used together\n");
writeln("Refer to --help to determine which command option you should use.\n");
oneDrive.http.shutdown();
return EXIT_FAILURE;
}
// Initialize the item database
log.vlog("Opening the item database ...");
if (!dryRun) {