adept/cmd/version.go
Gregory Ballantine 9b59d7485e
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Added a version subcommand
2022-09-16 23:21:47 -04:00

29 lines
571 B
Go

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")
},
}