add lograw option

This commit is contained in:
w1ndyb0y
2020-12-21 16:18:22 +08:00
parent 481870cea9
commit 92a10cd4e6
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -24,10 +24,11 @@ import (
)
var (
cfgFile string
device string
cfgFile string
device string
baudrate int
bytesize byte
lograw bool
dbFile string
dbInit bool
@@ -86,13 +87,13 @@ func initConfig() {
viper.AutomaticEnv() // read in environment variables that match
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Println("Using config file:", viper.ConfigFileUsed())
device = viper.GetString("serial.device")
baudrate = viper.GetInt("serial.baudrate")
bytesize = byte(viper.GetInt("serial.bytesize"))
lograw = viper.GetBool("serial.lograw")
dbFile = viper.GetString("sqlite.file")
dbInit = viper.GetBool("sqlite.init")
}