PKGBUILD/cmd/cmd.go
2018-11-28 18:07:20 +01:00

30 lines
689 B
Go

package cmd
import (
"git.cryptic.systems/fh-trier/go-flucky/cmd/config"
"git.cryptic.systems/fh-trier/go-flucky/cmd/remote"
"git.cryptic.systems/fh-trier/go-flucky/cmd/sensor"
"github.com/spf13/cobra"
)
var configDir string
var rootCmd = &cobra.Command{
Use: "flucky",
Short: "Read from sensors",
}
// Execute a
func Execute(version string) {
rootCmd.Version = version
rootCmd.PersistentFlags().StringVarP(&configDir, "config", "c", "/etc/flucky", "The base directory for all configuration files.")
config.InitCmd(rootCmd, configDir)
remote.InitCmd(rootCmd, configDir)
sensor.InitCmd(rootCmd, configDir)
//temperature.InitCmd(rootCmd, configDir)
rootCmd.Execute()
}