From 727df34aa104e1476b65a8d312e4eda679a3b016 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Wed, 10 Mar 2021 07:31:31 +0100 Subject: [PATCH] cmd/syncthing: Correct name of HiddenConsole flag (fixes #7446) (#7447) --- cmd/syncthing/main.go | 2 +- cmd/syncthing/options_others.go | 13 +++++++++++++ cmd/syncthing/options_windows.go | 11 +++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 cmd/syncthing/options_others.go create mode 100644 cmd/syncthing/options_windows.go diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 59509012b..f63ec3cc6 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -139,6 +139,7 @@ var entrypoint struct { // serveOptions are the options for the `syncthing serve` command. type serveOptions struct { + buildServeOptions AllowNewerConfig bool `help:"Allow loading newer than current config version"` Audit bool `help:"Write events to audit file"` AuditFile string `name:"auditfile" placeholder:"PATH" help:"Specify audit file (use \"-\" for stdout, \"--\" for stderr)"` @@ -149,7 +150,6 @@ type serveOptions struct { GenerateDir string `name:"generate" placeholder:"PATH" help:"Generate key and config in specified dir, then exit"` GUIAddress string `name:"gui-address" placeholder:"URL" help:"Override GUI address (e.g. \"http://192.0.2.42:8443\")"` GUIAPIKey string `name:"gui-apikey" placeholder:"API-KEY" help:"Override GUI API key"` - HideConsole bool `help:"Hide console window (Windows only)"` HomeDir string `name:"home" placeholder:"PATH" help:"Set configuration and data directory"` LogFile string `name:"logfile" default:"${logFile}" placeholder:"PATH" help:"Log file name (see below)"` LogFlags int `name:"logflags" default:"${logFlags}" placeholder:"BITS" help:"Select information in log line prefix (see below)"` diff --git a/cmd/syncthing/options_others.go b/cmd/syncthing/options_others.go new file mode 100644 index 000000000..2fce60e66 --- /dev/null +++ b/cmd/syncthing/options_others.go @@ -0,0 +1,13 @@ +// Copyright (C) 2021 The Syncthing Authors. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +// +build !windows + +package main + +type buildServeOptions struct { + HideConsole bool `hidden:""` +} diff --git a/cmd/syncthing/options_windows.go b/cmd/syncthing/options_windows.go new file mode 100644 index 000000000..38d26a22a --- /dev/null +++ b/cmd/syncthing/options_windows.go @@ -0,0 +1,11 @@ +// Copyright (C) 2021 The Syncthing Authors. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +package main + +type buildServeOptions struct { + HideConsole bool `name:"no-console" help:"Hide console window"` +}