blob: 269a5feab430498ec395d4d46d2c97900d2f35ba [file] [log] [blame]
avm9996388e622d2021-01-22 18:57:58 +01001package main
2
3import (
4 "github.com/spf13/cobra"
5
6 "github.com/flashmob/go-guerrilla"
7)
8
9var versionCmd = &cobra.Command{
10 Use: "version",
11 Short: "Print the version info",
12 Long: `Every software has a version. This is Guerrilla's`,
13 Run: func(cmd *cobra.Command, args []string) {
14 logVersion()
15 },
16}
17
18func init() {
19 rootCmd.AddCommand(versionCmd)
20}
21
22func logVersion() {
23 mainlog.Infof("Using guerrilla %s", guerrilla.Version)
24 mainlog.Debugf("Build Time: %s", guerrilla.BuildTime)
25 mainlog.Debugf("Commit: %s", guerrilla.Commit)
26}