PKGBUILD/cmd/config/config.go

28 lines
522 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",
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)
}