-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.go
82 lines (75 loc) · 2.29 KB
/
main.go
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright (c) 2022 Wireleap
package main
import (
"os"
"github.com/wireleap/common/api/interfaces/clientcontract"
"github.com/wireleap/common/api/interfaces/clientdir"
"github.com/wireleap/common/api/interfaces/clientrelay"
"github.com/wireleap/common/cli"
"github.com/wireleap/common/cli/commonsub/commonlib"
"github.com/wireleap/common/cli/commonsub/migratecmd"
"github.com/wireleap/common/cli/commonsub/rollbackcmd"
"github.com/wireleap/common/cli/commonsub/superviseupgradecmd"
"github.com/wireleap/common/cli/commonsub/upgradecmd"
"github.com/wireleap/common/cli/upgrade"
"github.com/wireleap/client/sub/accesskeyscmd"
"github.com/wireleap/client/sub/configcmd"
"github.com/wireleap/client/sub/execcmd"
"github.com/wireleap/client/sub/httpgetcmd"
"github.com/wireleap/client/sub/initcmd"
"github.com/wireleap/client/sub/interceptcmd"
"github.com/wireleap/client/sub/logcmd"
"github.com/wireleap/client/sub/reloadcmd"
"github.com/wireleap/client/sub/restartcmd"
"github.com/wireleap/client/sub/sockscmd"
"github.com/wireleap/client/sub/startcmd"
"github.com/wireleap/client/sub/statuscmd"
"github.com/wireleap/client/sub/stopcmd"
"github.com/wireleap/client/sub/tuncmd"
"github.com/wireleap/client/sub/versioncmd"
"github.com/wireleap/client/version"
)
const binname = "wireleap"
func main() {
fm := cli.Home()
cli.CLI{
Subcmds: []*cli.Subcmd{
initcmd.Cmd(),
configcmd.Cmd(fm),
accesskeyscmd.Cmd(),
startcmd.Cmd(binname),
statuscmd.Cmd(binname),
reloadcmd.Cmd(binname),
restartcmd.Cmd(binname, startcmd.Cmd(binname).Run, stopcmd.Cmd(binname).Run),
stopcmd.Cmd(binname),
logcmd.Cmd(binname),
tuncmd.Cmd(),
sockscmd.Cmd(),
interceptcmd.Cmd(),
httpgetcmd.Cmd(),
execcmd.Cmd(),
upgradecmd.Cmd(
binname,
upgrade.ExecutorSupervised,
version.VERSION,
version.LatestChannelVersion,
),
rollbackcmd.Cmd(commonlib.Context{
BinName: binname,
PostHook: version.PostRollbackHook,
}),
superviseupgradecmd.Cmd(commonlib.Context{
BinName: binname,
NewVersion: version.VERSION,
PostHook: version.PostUpgradeHook,
}),
migratecmd.Cmd(binname, version.MIGRATIONS, version.VERSION),
versioncmd.Cmd(
&version.VERSION,
clientdir.T,
clientcontract.T,
clientrelay.T,
),
},
}.Parse(os.Args).Run(fm)
}