summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/hashicorp/go-sockaddr/cmd/sockaddr/commands.go
blob: ca2e23145e25b4290196d7fa881706b10f0729b3 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
package main

import (
	"os"

	"github.com/hashicorp/go-sockaddr/cmd/sockaddr/command"
	"github.com/mitchellh/cli"
)

// Commands is the mapping of all the available CLI commands.
var Commands map[string]cli.CommandFactory

func init() {
	ui := &cli.BasicUi{Writer: os.Stdout}

	Commands = map[string]cli.CommandFactory{
		"dump": func() (cli.Command, error) {
			return &command.DumpCommand{
				Ui: ui,
			}, nil
		},
		"eval": func() (cli.Command, error) {
			return &command.EvalCommand{
				Ui: ui,
			}, nil
		},
		"rfc": func() (cli.Command, error) {
			return &command.RFCCommand{
				Ui: ui,
			}, nil
		},
		"rfc list": func() (cli.Command, error) {
			return &command.RFCListCommand{
				Ui: ui,
			}, nil
		},
		"tech-support": func() (cli.Command, error) {
			return &command.TechSupportCommand{
				Ui: ui,
			}, nil
		},
		"version": func() (cli.Command, error) {
			return &command.VersionCommand{
				HumanVersion: GetHumanVersion(),
				Ui:           ui,
			}, nil
		},
	}
}