PKGBUILD/cmd/cmd.go
2018-12-07 20:42:30 +01:00

33 lines
838 B
Go

package cmd
import (
"git.cryptic.systems/fh-trier/go-flucky/cmd/config"
"git.cryptic.systems/fh-trier/go-flucky/cmd/humidity"
"git.cryptic.systems/fh-trier/go-flucky/cmd/remote"
"git.cryptic.systems/fh-trier/go-flucky/cmd/sensor"
"git.cryptic.systems/fh-trier/go-flucky/cmd/temperature"
"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)
humidity.InitCmd(rootCmd, configDir)
remote.InitCmd(rootCmd, configDir)
sensor.InitCmd(rootCmd, configDir)
temperature.InitCmd(rootCmd, configDir)
rootCmd.Execute()
}