-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
49 lines (42 loc) · 1.32 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
// Copyright 2016 EF CTX. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"os"
"github.com/tsuru/tsuru-client/tsuru/admin"
"github.com/tsuru/tsuru-client/tsuru/client"
"github.com/tsuru/tsuru/cmd"
)
const version = "0.1"
var baseCommandsToRemove = []string{"target-add", "target-list", "target-remove", "target-set"}
func buildManager(name string) *cmd.Manager {
mngr := cmd.BuildBaseManager(name, version, "", nil)
for _, c := range baseCommandsToRemove {
delete(mngr.Commands, c)
}
mngr.Register(envList{})
mngr.Register(targetSet{})
mngr.Register(admin.PlatformList{})
mngr.Register(&client.TeamList{})
mngr.Register(&client.TeamCreate{})
mngr.Register(&client.TeamRemove{})
mngr.Register(&client.PlanList{})
mngr.Register(&projectCreate{})
mngr.Register(&projectUpdate{})
mngr.Register(&projectRemove{})
mngr.Register(&projectList{})
mngr.Register(&projectInfo{})
mngr.Register(&projectEnvInfo{})
mngr.Register(&projectEnvVarGet{})
mngr.Register(&projectEnvVarSet{})
mngr.Register(&projectEnvVarUnset{})
mngr.Register(&projectDeploy{})
mngr.Register(&projectDeployList{})
mngr.Register(&projectLog{})
return mngr
}
func main() {
name := cmd.ExtractProgramName(os.Args[0])
buildManager(name).Run(os.Args[1:])
}