33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package temperature
|
|
|
|
// 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) {
|
|
|
|
// temperatureLogfileInput := logfile.New(args[0])
|
|
// temperatures, err := temperatureLogfileInput.ReadTemperatures()
|
|
// if err != nil {
|
|
// log.Fatalln(err)
|
|
// }
|
|
|
|
// if compression {
|
|
// temperatures = logfile.CompressTemperature(temperatures)
|
|
// }
|
|
|
|
// temperatureLogfileOutput := logfile.New(args[1])
|
|
// err = temperatureLogfileOutput.WriteTemperatures(temperatures)
|
|
// if err != nil {
|
|
// log.Fatalln(err)
|
|
// }
|
|
// },
|
|
// }
|
|
|
|
// 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")
|
|
// }
|