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