mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
22 lines
413 B
Go
22 lines
413 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var Version = "dev"
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print the version.",
|
|
Long: "The version of headscale.",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
output, _ := cmd.Flags().GetString("output")
|
|
SuccessOutput(map[string]string{"version": Version}, Version, output)
|
|
},
|
|
}
|