ref: bd7bd9b30650ca74cf4997a5e1b3d8b7bc6e5a6b cisco/csc/cmd/version.go -rw-r--r-- 354 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package cmd

import (
	"cisco/sdk"
	"fmt"
	"github.com/spf13/cobra"
)

var VersionRootCmd = &cobra.Command{
	Use:   "version",
	Short: "Display command line version",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("%s-%s (%s)\n", cisco.GitTag(), cisco.GitRev(), cisco.GitBranch())
	},
}

func init() {
	RootCmd.AddCommand(VersionRootCmd)
}