mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			439 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			439 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package cli
 | |
| 
 | |
| import (
 | |
| 	"fmt"
 | |
| 	"github.com/spf13/cobra"
 | |
| 	"strings"
 | |
| )
 | |
| 
 | |
| var version = "dev"
 | |
| 
 | |
| var VersionCmd = &cobra.Command{
 | |
| 	Use:   "version",
 | |
| 	Short: "Print the version.",
 | |
| 	Long:  "The version of headscale.",
 | |
| 	Run: func(cmd *cobra.Command, args []string) {
 | |
| 		o, _ := cmd.Flags().GetString("output")
 | |
| 		if strings.HasPrefix(o, "json") {
 | |
| 			JsonOutput(map[string]string{"version": version}, nil, o)
 | |
| 			return
 | |
| 		}
 | |
| 		fmt.Println(version)
 | |
| 	},
 | |
| }
 |