From ab1739ba34f899b5c1ee709e9e7ab61ac94b4747 Mon Sep 17 00:00:00 2001 From: Stefan Tatschner Date: Sun, 27 Nov 2016 11:21:05 +0000 Subject: [PATCH] cmd/syncthing: Trigger usage message on extra CLI parameters fixes: #3690 GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3763 --- cmd/syncthing/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 9ecb46fe..22eb1c56 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -278,6 +278,11 @@ func parseCommandLineOptions() RuntimeOptions { flag.Usage = usageFor(flag.CommandLine, usage, longUsage) flag.Parse() + if len(flag.Args()) > 0 { + flag.Usage() + os.Exit(2) + } + return options }