PKGBUILD/cmd/cmd.go

30 lines
689 B
Go
Raw Normal View History

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/config"
"git.cryptic.systems/fh-trier/go-flucky/cmd/remote"
"git.cryptic.systems/fh-trier/go-flucky/cmd/sensor"
2018-11-07 19:07:15 +00:00
"github.com/spf13/cobra"
)
2018-11-19 21:36:21 +00:00
var configDir string
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
2018-11-19 21:36:21 +00:00
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)
2018-11-28 17:07:20 +00:00
//temperature.InitCmd(rootCmd, configDir)
2018-11-07 19:07:15 +00:00
rootCmd.Execute()
}