~bigbes/ci-cacher

ref: 176b6cb94fda9f283356d899011c2be49e23d9c9 ci-cacher/cmd/version.go -rw-r--r-- 716 bytes
176b6cb9 — Eugene Blikh Bump VERSION to 0.1.0 for tag 2 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cmd

import (
	"fmt"

	"github.com/spf13/cobra"

	"go.bigb.es/cacher/internal/version"
)

const banner = `                       _
   ___ __ _  ___ _ __ | |__   ___ _ __
  / __/ _` + "`" + ` |/ __| '_ \| '_ \ / _ \ '__|
 | (_| (_| | (__| | | | | | |  __/ |
  \___\__,_|\___|_| |_|_| |_|\___|_|`

var versionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print version information",
	Run: func(cmd *cobra.Command, args []string) {
		info := version.Get()
		fmt.Println(banner)
		fmt.Println("cacher: S3-backed CI cache helper for builds.sr.ht — replaces .builds/lib/ci-lib.sh")
		fmt.Println("go.bigb.es/cacher")
		fmt.Println()
		fmt.Println(info)
	},
}

func init() {
	rootCmd.AddCommand(versionCmd)
}