PKGBUILD/cmd/sensor/enable.go

25 lines
417 B
Go
Raw Normal View History

2018-11-28 17:07:20 +00:00
package sensor
import (
"log"
"git.cryptic.systems/fh-trier/go-flucky/pkg/sensor"
"github.com/spf13/cobra"
)
var enableSensorCmd = &cobra.Command{
Use: "enable",
Short: "Enable Sensor",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
if err := sensor.Enable(args[0], configDir); err != nil {
log.Fatal(err)
}
},
}
func init() {
sensorCmd.AddCommand(enableSensorCmd)
}