2018-11-07 19:07:15 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2018-11-19 21:36:21 +00:00
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/cmd/remote"
|
2018-11-07 19:07:15 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2019-02-17 17:23:59 +00:00
|
|
|
var cfg string
|
2018-11-19 21:36:21 +00:00
|
|
|
|
2018-11-07 19:07:15 +00:00
|
|
|
var rootCmd = &cobra.Command{
|
|
|
|
Use: "flucky",
|
|
|
|
Short: "Read from sensors",
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute a
|
|
|
|
func Execute(version string) {
|
|
|
|
rootCmd.Version = version
|
|
|
|
|
2019-02-17 17:23:59 +00:00
|
|
|
rootCmd.PersistentFlags().StringVar(&cfg, "config", "/etc/flucky/config.json", "Config file")
|
2018-11-19 21:36:21 +00:00
|
|
|
|
2019-02-17 17:23:59 +00:00
|
|
|
// humidity.InitCmd(rootCmd, configDir)
|
|
|
|
remote.InitCmd(rootCmd, cfg)
|
|
|
|
// sensor.InitCmd(rootCmd, configDir)
|
|
|
|
// temperature.InitCmd(rootCmd, configDir)
|
2018-11-07 19:07:15 +00:00
|
|
|
|
|
|
|
rootCmd.Execute()
|
|
|
|
}
|