From 4c8aa14e07f2b18b340a906326500711fdc7f208 Mon Sep 17 00:00:00 2001 From: Antony Male Date: Wed, 18 Jan 2017 12:19:22 +0000 Subject: [PATCH] cmd/syncthing: Fail if -logfile and -no-restart passed together (fixes #3912) GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3915 --- cmd/syncthing/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index a29a6c167..285c8a717 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -320,6 +320,12 @@ func main() { os.Setenv("STGUIAPIKEY", options.guiAPIKey) } + // Check for options which are not compatible with each other + // Have to check logfile before it's set to the default below - we only want to complain if they set -logfile explicitly, not if it's set to its default location + if options.noRestart && options.logFile != "" { + l.Fatalln("-logfile may not be used with -no-restart or STNORESTART") + } + if options.hideConsole { osutil.HideConsole() }