mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 08:53:05 +00:00
Use new json wrapper for version command
This commit is contained in:
parent
9e9049307e
commit
dce82f4323
1 changed files with 2 additions and 9 deletions
|
@ -1,9 +1,6 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,11 +15,7 @@ var versionCmd = &cobra.Command{
|
||||||
Short: "Print the version.",
|
Short: "Print the version.",
|
||||||
Long: "The version of headscale.",
|
Long: "The version of headscale.",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
o, _ := cmd.Flags().GetString("output")
|
output, _ := cmd.Flags().GetString("output")
|
||||||
if strings.HasPrefix(o, "json") {
|
SuccessOutput(map[string]string{"version": Version}, Version, output)
|
||||||
JsonOutput(map[string]string{"version": Version}, nil, o)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Println(Version)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue