PKGBUILD/cmd/cmd.go

33 lines
838 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"
2018-12-04 18:11:50 +00:00
"git.cryptic.systems/fh-trier/go-flucky/cmd/humidity"
2018-11-19 21:36:21 +00:00
"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"
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)
2018-12-04 18:11:50 +00:00
humidity.InitCmd(rootCmd, configDir)
2018-11-19 21:36:21 +00:00
remote.InitCmd(rootCmd, configDir)
sensor.InitCmd(rootCmd, configDir)
temperature.InitCmd(rootCmd, configDir)
2018-11-07 19:07:15 +00:00
rootCmd.Execute()
}