main.go

v1.4.0
Doc Versions Source
1
package main
2
3
import (
4
	"fmt"
5
	"os"
6
7
	"github.com/spf13/cobra"
8
)
9
10
// Set via ldflags at build time:
11
//
12
//	go build -ldflags "-X main.version=v1.0.0 -X main.commit=$(git rev-parse --short HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
13
var (
14
	version = "dev"
15
	commit  = "unknown"
16
	date    = "unknown"
17
)
18
19
func main() {
20
	root := &cobra.Command{
21
		Use:     "curator",
22
		Short:   "Vanity Go module server with GOPROXY, sumdb, admin UI, and documentation",
23
		Version: fmt.Sprintf("%s (commit: %s, built: %s)", version, commit, date),
24
	}
25
26
	root.AddCommand(serveCmd())
27
	root.AddCommand(genkeyCmd())
28
	root.AddCommand(verifierCmd())
29
	root.AddCommand(importCmd())
30
	root.AddCommand(initConfigCmd())
31
32
	if err := root.Execute(); err != nil {
33
		fmt.Fprintln(os.Stderr, err)
34
		os.Exit(1)
35
	}
36
}
37

Source Files