mirror of
https://github.com/juanfont/headscale.git
synced 2025-10-19 11:15:48 +02:00
25 lines
570 B
Go
25 lines
570 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/juanfont/headscale/hscontrol/types"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
versionCmd.Flags().StringP("output", "o", "", "Output format. Empty for human-readable, 'json', 'json-line' or 'yaml'")
|
|
}
|
|
|
|
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")
|
|
|
|
info := types.GetVersionInfo()
|
|
|
|
SuccessOutput(info, info.String(), output)
|
|
},
|
|
}
|