diff options
| author | Paul Buetow <paul@buetow.org> | 2021-08-21 09:10:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-08-21 09:10:31 +0300 |
| commit | a92857684b3b7843dc99ea71c49ee4af8b298392 (patch) | |
| tree | a1623d49ebcbf323640acea2c6a18131b2718607 /cmd | |
| parent | d48f344cf1a6e0b479629d7a96c1402b1733106e (diff) | |
can specify logDir of dserver via command line
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/dserver/main.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/dserver/main.go b/cmd/dserver/main.go index 5f72cb8..f5f0536 100644 --- a/cmd/dserver/main.go +++ b/cmd/dserver/main.go @@ -22,27 +22,32 @@ import ( // The evil begins here. func main() { var cfgFile string + var color bool var debugEnable bool var displayVersion bool - var color bool + var logDir string var pprof int var shutdownAfter int var sshPort int user.NoRootCheck() + flag.BoolVar(&color, "color", false, "Enable ANSII terminal colors") + flag.BoolVar(&config.ServerRelaxedAuthEnable, "relaxedAuth", false, "Enable relaxced SSH auth mode (don't use in production!)") flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.BoolVar(&config.ServerRelaxedAuthEnable, "relaxedAuth", false, "Enable relaxced SSH auth mode (don't use in production!)") - flag.BoolVar(&color, "color", false, "Enable ANSII terminal colors") flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.IntVar(&shutdownAfter, "shutdownAfter", 0, "Automatically shutdown after so many seconds") flag.IntVar(&sshPort, "port", 2222, "SSH server port") flag.StringVar(&cfgFile, "cfg", "", "Config file path") + flag.StringVar(&logDir, "logDir", "", "Log dir path") flag.Parse() config.Read(cfgFile, sshPort) config.Client.TermColorsEnable = color + if logDir != "" { + config.Common.LogDir = logDir + } if displayVersion { version.PrintAndExit() |
