PKGBUILD/cmd/temperature/get.go

28 lines
481 B
Go
Raw Normal View History

package temperature
2018-11-19 21:36:21 +00:00
import (
"log"
"os"
"git.cryptic.systems/fh-trier/go-flucky/pkg/temperature"
"github.com/spf13/cobra"
)
var push bool
2018-11-19 21:36:21 +00:00
var getTemperatureCmd = &cobra.Command{
Use: "get",
Short: "get temperature from sensor",
Args: cobra.ExactArgs(1),
2018-11-19 21:36:21 +00:00
Run: func(cmd *cobra.Command, args []string) {
if err := temperature.Get(os.Stdout, args[0], configDir); err != nil {
2018-11-19 21:36:21 +00:00
log.Fatal(err)
}
},
}
func init() {
temperatureCmd.AddCommand(getTemperatureCmd)
}