From 04a76e424aad4a21dde0af42c0c5753b6c5959e2 Mon Sep 17 00:00:00 2001 From: scruzin Date: Sat, 5 Jan 2019 08:48:47 +1030 Subject: [PATCH] Added LogPath and ConfigFile command line flags. --- cmd/revid-cli/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 68d5c791..14cffb13 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -119,11 +119,13 @@ func handleFlags() revid.Config { verticalFlipPtr = flag.Bool("VerticalFlip", false, "Flip video vertically: Yes, No") horizontalFlipPtr = flag.Bool("HorizontalFlip", false, "Flip video horizontally: Yes, No") rtpAddrPtr = flag.String("RtpAddr", "", "Rtp destination address: : (port is generally 6970-6999)") + logPathPtr = flag.String("LogPath", defaultLogPath, "The log path") + configFilePtr = flag.String("ConfigFile", "", "NetSender config file") ) flag.Parse() - log = logger.New(defaultLogVerbosity, &smartlogger.New("/var/log/netsender").LogRoller) + log = logger.New(defaultLogVerbosity, &smartlogger.New(*logPathPtr).LogRoller) cfg.Logger = log @@ -229,6 +231,10 @@ func handleFlags() revid.Config { log.Log(logger.Error, pkg+"bad verbosity argument") } + if *configFilePtr != "" { + netsender.ConfigFile = *configFilePtr + } + cfg.Quantize = *quantizePtr cfg.FlipHorizontal = *horizontalFlipPtr cfg.FlipVertical = *verticalFlipPtr