feat(cmd/rgb-led): add subcommands to operate with rgb-leds
This commit is contained in:
@ -9,14 +9,14 @@ import (
|
||||
)
|
||||
|
||||
var compression bool
|
||||
var configPath string
|
||||
var configFile string
|
||||
|
||||
var daemonCmd = &cobra.Command{
|
||||
Use: "daemon",
|
||||
Short: "Read continuously data from all enabled sensors",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// read configuration
|
||||
cnf, err := config.Read(configPath)
|
||||
cnf, err := config.Read(configFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
@ -29,8 +29,8 @@ var daemonCmd = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
func InitCmd(cmd *cobra.Command, cnfPath string) {
|
||||
configPath = cnfPath
|
||||
func InitCmd(cmd *cobra.Command, cnfFile string) {
|
||||
configFile = cnfFile
|
||||
cmd.AddCommand(daemonCmd)
|
||||
daemonCmd.Flags().BoolVarP(&compression, "compression", "c", true, "Compress measured values")
|
||||
|
||||
|
Reference in New Issue
Block a user