adept/cmd/version.go

29 lines
571 B
Go
Raw Normal View History

2022-09-16 23:21:47 -04:00
package cmd
import (
"log"
"runtime"
"github.com/spf13/cobra"
)
var (
version string
)
// initializes the sub-command
func init() {
rootCmd.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Display version info.",
Long: `In case you're curious, run this command to find out the version info.`,
Run: func(cmd *cobra.Command, args []string) {
log.Printf("Adept version %s", version)
log.Printf("Built with Go %s", runtime.Version())
log.Printf("View source at https://git.metaunix.net/BitGoblin/adept")
},
}