~bigbes/ci-cacher

ref: 519ce411ce7e77bc46ba4eb12c4619c838b3f059 ci-cacher/cmd/version.go -rw-r--r-- 716 bytes
519ce411 — Eugene Blikh Bump VERSION to 0.1.1 for tag a day 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)
}