2018-11-28 17:07:20 +00:00
|
|
|
package sensor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/sensor"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var quiet bool
|
|
|
|
|
|
|
|
var listSensorCmd = &cobra.Command{
|
2018-12-07 21:50:28 +00:00
|
|
|
Use: "ls",
|
|
|
|
Short: "List Sensors",
|
|
|
|
Aliases: []string{"list"},
|
2018-11-28 17:07:20 +00:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if err := sensor.Print(os.Stdout, configDir, quiet); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
//28-01143277168e
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
sensorCmd.AddCommand(listSensorCmd)
|
|
|
|
|
|
|
|
listSensorCmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "List only sensor id's")
|
|
|
|
}
|