From 92a10cd4e6eaa64ea2486eafc3bdd0a8e7a22286 Mon Sep 17 00:00:00 2001 From: w1ndyb0y Date: Mon, 21 Dec 2020 16:18:22 +0800 Subject: [PATCH] add lograw option --- cmd/root.go | 7 ++++--- telegram.yaml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index ac88a72..b94343a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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") } diff --git a/telegram.yaml b/telegram.yaml index 9fc6efc..1d18547 100644 --- a/telegram.yaml +++ b/telegram.yaml @@ -2,6 +2,7 @@ serial: device: ttyS1 baudrate: 9600 bytesize: 7 + lograw: true sqlite: