aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 1c6a0b61efa040464152ad4fd34cecaa5907ab87 (plain)
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
33
34
35
36
package main

import (
	"context"
	"flag"
	"log"
	"os"
	"path"

	"github.com/google/subcommands"
)

func init() {
	log.SetFlags(0)
	log.SetPrefix(progName() + ": ")
}

func progName() string {
	return path.Base(os.Args[0])
}

func main() {
	subcommands.Register(subcommands.CommandsCommand(), "")
	subcommands.Register(subcommands.FlagsCommand(), "")
	subcommands.Register(subcommands.HelpCommand(), "")

	subcommands.Register(&checkCommand{}, "")
	subcommands.Register(&generateCommand{}, "")
	subcommands.Register(&signCommand{}, "")
	subcommands.Register(&verifyCommand{}, "")

	flag.Parse()

	ctx := context.Background()
	os.Exit(int(subcommands.Execute(ctx)))
}