24 lines
513 B
Go
24 lines
513 B
Go
|
package temperature
|
||
|
|
||
|
import (
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
var writeLog bool
|
||
|
|
||
|
var printTemperatureCmd = &cobra.Command{
|
||
|
Use: "print",
|
||
|
Short: "print all temperatures from all sensors secondly",
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
|
||
|
// if err := temperature.Print(os.Stdout, configDir, writeLog); err != nil {
|
||
|
// log.Fatal(err)
|
||
|
// }
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
temperatureCmd.AddCommand(printTemperatureCmd)
|
||
|
printTemperatureCmd.Flags().BoolVarP(&writeLog, "log", "l", true, "Append to logfiles")
|
||
|
}
|