cmd/syncthing: Trigger usage message on extra CLI parameters

fixes: #3690

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3763
This commit is contained in:
Stefan Tatschner 2016-11-27 11:21:05 +00:00 committed by Audrius Butkevicius
parent fc1430aa92
commit ab1739ba34
1 changed files with 5 additions and 0 deletions

View File

@ -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
}