PKGBUILD/cmd/config/config.go
Markus Pesch f8e829d3d2
fix: sync and fetch temperatures
changes:
- add sync command to synchronize device sensor information with remote
  servers
- fix fetch functions to get temperatures
2018-11-29 16:06:39 +01:00

29 lines
550 B
Go

package config
import (
"git.cryptic.systems/fh-trier/go-flucky/pkg/config"
"github.com/spf13/cobra"
)
var configDir string
var configCmd = &cobra.Command{
Use: "config",
Short: "Manage Configuration",
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
if args[0] == "device.name" {
config.DeviceName(args[1], configDir)
} else if args[0] == "device.location" {
config.DeviceLocation(args[1], configDir)
}
},
}
func InitCmd(cmd *cobra.Command, c string) {
configDir = c
cmd.AddCommand(configCmd)
}