fix: set config, set remote

This commit is contained in:
2018-11-19 22:36:21 +01:00
parent 54dd2191d6
commit dd7ea3156e
24 changed files with 1338 additions and 58 deletions

25
cmd/temperature/get.go Normal file
View File

@ -0,0 +1,25 @@
package remote
import (
"log"
"os"
"git.cryptic.systems/fh-trier/go-flucky/pkg/temperature"
"github.com/spf13/cobra"
)
var getTemperatureCmd = &cobra.Command{
Use: "get",
Short: "get temperature from sensor",
// Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
if err := temperature.Get(os.Stdout); err != nil {
log.Fatal(err)
}
},
}
func init() {
temperatureCmd.AddCommand(getTemperatureCmd)
}

View File

@ -1,24 +1,16 @@
package temperature
package remote
import (
"log"
"os"
"git.cryptic.systems/fh-trier/go-flucky/pkg/temperature"
"github.com/spf13/cobra"
)
var temperatureCmd = &cobra.Command{
Use: "temperature",
Short: "temperature",
Run: func(cmd *cobra.Command, args []string) {
if err := temperature.Print(os.Stdout); err != nil {
log.Fatal(err)
}
},
Short: "Read temperature from sensor",
}
func InitCmd(cmd *cobra.Command) {
// Execute a
func Init(cmd *cobra.Command) {
cmd.AddCommand(temperatureCmd)