2019-06-21 10:12:25 +00:00
|
|
|
package temperature
|
|
|
|
|
2019-06-25 20:56:09 +00:00
|
|
|
// var convertTemperatureCmd = &cobra.Command{
|
|
|
|
// Use: "convert",
|
|
|
|
// Short: "Convert temperature logfiles into other markup language",
|
|
|
|
// Args: cobra.ExactArgs(2),
|
|
|
|
// Example: "flucky temperature convert /var/log/flucky/temperature.json /var/log/flucky/temperature.xml",
|
|
|
|
// Run: func(cmd *cobra.Command, args []string) {
|
2019-06-21 10:12:25 +00:00
|
|
|
|
2019-06-25 20:56:09 +00:00
|
|
|
// temperatureLogfileInput := logfile.New(args[0])
|
|
|
|
// temperatures, err := temperatureLogfileInput.ReadTemperatures()
|
|
|
|
// if err != nil {
|
|
|
|
// log.Fatalln(err)
|
|
|
|
// }
|
2019-06-21 10:12:25 +00:00
|
|
|
|
2019-06-25 20:56:09 +00:00
|
|
|
// if compression {
|
|
|
|
// temperatures = logfile.CompressTemperature(temperatures)
|
|
|
|
// }
|
2019-06-21 10:12:25 +00:00
|
|
|
|
2019-06-25 20:56:09 +00:00
|
|
|
// temperatureLogfileOutput := logfile.New(args[1])
|
|
|
|
// err = temperatureLogfileOutput.WriteTemperatures(temperatures)
|
|
|
|
// if err != nil {
|
|
|
|
// log.Fatalln(err)
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// }
|
2019-06-21 10:12:25 +00:00
|
|
|
|
2019-06-25 20:56:09 +00:00
|
|
|
// func init() {
|
|
|
|
// temperatureCmd.AddCommand(convertTemperatureCmd)
|
|
|
|
// convertTemperatureCmd.Flags().BoolVar(&compression, "compression", true, "Compress measured values")
|
|
|
|
// convertTemperatureCmd.Flags().Float64Var(&round, "round", 0.25, "Round values. The value 0 deactivates the function")
|
|
|
|
// }
|