fix(cmd): remove obsolete semver
This commit is contained in:
		@@ -3,7 +3,6 @@ package compression
 | 
			
		||||
import (
 | 
			
		||||
	"log"
 | 
			
		||||
 | 
			
		||||
	"github.com/Masterminds/semver"
 | 
			
		||||
	"github.com/go-flucky/flucky/pkg/storage"
 | 
			
		||||
	"github.com/go-flucky/flucky/pkg/storage/logfile"
 | 
			
		||||
 | 
			
		||||
@@ -13,7 +12,6 @@ import (
 | 
			
		||||
var (
 | 
			
		||||
	configFile *string
 | 
			
		||||
	round      float64
 | 
			
		||||
	version    *semver.Version
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var compressionCmd = &cobra.Command{
 | 
			
		||||
@@ -42,9 +40,8 @@ var compressionCmd = &cobra.Command{
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sverion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sverion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(compressionCmd)
 | 
			
		||||
	compressionCmd.Flags().Float64Var(&round, "round", 0, "Round values. The value 0 deactivates the function")
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,6 @@ package convert
 | 
			
		||||
import (
 | 
			
		||||
	"log"
 | 
			
		||||
 | 
			
		||||
	"github.com/Masterminds/semver"
 | 
			
		||||
	"github.com/go-flucky/flucky/pkg/storage"
 | 
			
		||||
	"github.com/go-flucky/flucky/pkg/storage/logfile"
 | 
			
		||||
 | 
			
		||||
@@ -14,8 +13,6 @@ var (
 | 
			
		||||
	compression bool
 | 
			
		||||
	configFile  *string
 | 
			
		||||
	round       float64
 | 
			
		||||
 | 
			
		||||
	version *semver.Version
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var convertCmd = &cobra.Command{
 | 
			
		||||
@@ -48,9 +45,8 @@ var convertCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// InitCmd ...
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(convertCmd)
 | 
			
		||||
	convertCmd.Flags().BoolVar(&compression, "compression", false, "Compress measured values")
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
package humidity
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/Masterminds/semver"
 | 
			
		||||
	"github.com/spf13/cobra"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -9,8 +8,6 @@ var (
 | 
			
		||||
	compression bool
 | 
			
		||||
	configFile  *string
 | 
			
		||||
	round       float64
 | 
			
		||||
 | 
			
		||||
	version *semver.Version
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var humidityCmd = &cobra.Command{
 | 
			
		||||
@@ -19,9 +16,8 @@ var humidityCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Execute a
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(humidityCmd)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,9 +19,8 @@ var pressureCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Execute a
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(pressureCmd)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,9 +17,8 @@ var rgbLedCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// InitCmd da
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(rgbLedCmd)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								cmd/root.go
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								cmd/root.go
									
									
									
									
									
								
							@@ -70,13 +70,13 @@ func Execute(version *semver.Version) {
 | 
			
		||||
	rootCmd.PersistentFlags().StringVar(&configFile, "config", "/etc/flucky/config.json", "Config file")
 | 
			
		||||
 | 
			
		||||
	completion.InitCmd(rootCmd)
 | 
			
		||||
	compression.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	convert.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	daemon.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	humidity.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	pressure.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	rgbled.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	sensor.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	temperature.InitCmd(rootCmd, &configFile, version)
 | 
			
		||||
	compression.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	convert.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	daemon.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	humidity.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	pressure.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	rgbled.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	sensor.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	temperature.InitCmd(rootCmd, &configFile)
 | 
			
		||||
	rootCmd.Execute()
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,9 +17,8 @@ var sensorCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// InitCmd da
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(sensorCmd)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -23,9 +23,8 @@ var temperatureCmd = &cobra.Command{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// InitCmd initialize the subcommand
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
 | 
			
		||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
 | 
			
		||||
	configFile = cnfFile
 | 
			
		||||
	version = sversion
 | 
			
		||||
 | 
			
		||||
	cmd.AddCommand(temperatureCmd)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user