Skip to content

Commit

Permalink
Add Go version to version output
Browse files Browse the repository at this point in the history
This adds the Go version to the version output and removes dead code.
  • Loading branch information
mcktr committed Jan 18, 2022
1 parent 361b6ae commit 1c5defe
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions cmd/check_fritz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package main

import (
"fmt"
"os"

"github.com/urfave/cli/v2"
"os"
"runtime"
)

// program version
Expand Down Expand Up @@ -67,11 +67,6 @@ func (ai *ArgumentInformation) setDebugMode() {
ai.Debug = true
}

func printVersion() {
fmt.Println("check_fritz v" + Version)
GlobalReturnCode = exitOk
}

func checkRequiredFlags(aI *ArgumentInformation) bool {
if aI.Hostname == nil || *aI.Hostname == "" {
fmt.Println("No hostname")
Expand Down Expand Up @@ -194,7 +189,7 @@ func main() {
Action: checkMain,
Name: "check_fritz",
Usage: "Check plugin to monitor a Fritz!Box",
Version: Version,
Version: fmt.Sprintf("%s/%s", Version, runtime.Version()),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "hostname",
Expand Down Expand Up @@ -294,11 +289,5 @@ METHODS:
smart_socketenergy Total power consumption of the last year of a socket switch (requires AIN),
smart_status current smart device status (requires AIN)
`

cli.VersionFlag = &cli.BoolFlag{
Name: "version", Aliases: []string{"V"},
Usage: "print the version",
}

app.Run(os.Args)
}

0 comments on commit 1c5defe

Please sign in to comment.