PKGBUILD/cmd/temperature/log.go

27 lines
475 B
Go

package temperature
import (
"log"
"os"
"git.cryptic.systems/fh-trier/go-flucky/pkg/logs"
"github.com/spf13/cobra"
)
var writeLog bool
var logTemperatureCmd = &cobra.Command{
Use: "log",
Short: "Log print all temperatures saved from logfile on stdout",
Run: func(cmd *cobra.Command, args []string) {
if err := logs.ListTemperatures(configDir, os.Stdout); err != nil {
log.Fatal(err)
}
},
}
func init() {
temperatureCmd.AddCommand(logTemperatureCmd)
}