From 002f9b7aec884edd544cb911b132d746bcc3ce27 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Sat, 23 Mar 2019 10:20:27 +1100 Subject: [PATCH] Prevent use of --synchronize & --monitor together (#431) * Prevent use of --synchronize & --monitor together --- src/main.d | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.d b/src/main.d index 80692180..bb9627e7 100644 --- a/src/main.d +++ b/src/main.d @@ -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) {