headscale/cmd/headscale/cli/version.go
Kristoffer Dalby 024ed59ea9
Some checks are pending
Tests / test (push) Waiting to run
more
2025-07-15 06:49:51 +00:00

23 lines
494 B
Go

package cli
import (
"github.com/juanfont/headscale/hscontrol/types"
"github.com/spf13/cobra"
)
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": types.Version,
"commit": types.GitCommitHash,
}, types.Version, output)
},
}