From b19885fdb3dc888152707b0c8cb98dc6567c2cbd Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Sat, 15 Sep 2018 07:17:31 +0100 Subject: [PATCH] cmd/syncthing: Add explicit -help flag (fixes #5193) (#5197) --- cmd/syncthing/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 64625a4f..66323b28 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -252,6 +252,7 @@ type RuntimeOptions struct { cpuProfile bool stRestarting bool logFlags int + showHelp bool } func defaultRuntimeOptions() RuntimeOptions { @@ -295,6 +296,7 @@ func parseCommandLineOptions() RuntimeOptions { flag.BoolVar(&options.doUpgrade, "upgrade", false, "Perform upgrade") flag.BoolVar(&options.doUpgradeCheck, "upgrade-check", false, "Check for available upgrade") flag.BoolVar(&options.showVersion, "version", false, "Show version") + flag.BoolVar(&options.showHelp, "help", false, "Show this help") flag.BoolVar(&options.showPaths, "paths", false, "Show configuration paths") flag.BoolVar(&options.showDeviceId, "device-id", false, "Show the device ID") flag.StringVar(&options.upgradeTo, "upgrade-to", options.upgradeTo, "Force upgrade directly from specified URL") @@ -381,6 +383,11 @@ func main() { return } + if options.showHelp { + flag.Usage() + return + } + if options.showPaths { showPaths(options) return