-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmain.go
106 lines (101 loc) · 3.73 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package main
//go:generate go run ./gen/main.go
//go:generate go fmt
import "github.com/posener/complete"
var dab = complete.Command{
Sub: complete.Commands{
"config": {
Sub: complete.Commands{
"add": {Args: newGeneric(predictConfigKeys, 1)}, "append": {Args: newGeneric(predictConfigKeys, 1)},
"get": {Args: newGeneric(predictConfigKeys, 1)}, "retrieve": {Args: newGeneric(predictConfigKeys, 1)},
"keys": {}, "tree": {},
"set": {Args: newGeneric(predictConfigKeys, 1)}, "update": {Args: newGeneric(predictConfigKeys, 1)}, "change": {Args: newGeneric(predictConfigKeys, 1)},
},
},
"network": {
Sub: complete.Commands{
"destroy": {}, "delete": {},
"shell": {}, "sh": {}, "cmd": {},
"recreate": {}, "up": {}, "rebuild": {},
"proxy": {},
},
},
"pki": {
Sub: complete.Commands{
"ready": {}, "up": {},
"issue": {}, "renew": {},
"destroy": {}, "delete": {},
},
},
"repo": {
Sub: complete.Commands{
"add": {Args: newGeneric(predictRepos, 1)}, "url": {Args: newGeneric(predictRepos, 1)}, "register": {Args: newGeneric(predictRepos, 1)},
"clone": {Args: newGeneric(predictRepos, 1)}, "download": {Args: newGeneric(predictRepos, 1)},
"list": {}, "check": {},
"fetch": {Args: newGeneric(predictRepos, 1)}, "update": {Args: newGeneric(predictRepos, 1)},
"entrypoint": {
Sub: map[string]complete.Command{
"create": {Args: newGeneric(predictRepos, 1)}, "new": {Args: newGeneric(predictRepos, 1)},
"list": {Args: newGeneric(predictRepos, 1)}, "available": {Args: newGeneric(predictRepos, 1)},
"run": {Args: complete.PredictOr(
newGeneric(predictRepos, 1),
newGeneric(predictEntrypoint, 2),
)},
"exec": {Args: complete.PredictOr(
newGeneric(predictRepos, 1),
newGeneric(predictEntrypoint, 2),
)},
"script": {Args: complete.PredictOr(
newGeneric(predictRepos, 1),
newGeneric(predictEntrypoint, 2),
)},
},
},
},
},
"group": {
Sub: map[string]complete.Command{
"repos": {Args: complete.PredictOr(
newGeneric(predictGroups, 1),
newGeneric(predictRepos, 2),
)},
"repo": {Args: complete.PredictOr(
newGeneric(predictGroups, 1),
newGeneric(predictRepos, 2),
)},
"groups": {Args: newGeneric(predictGroups, 1, 2)}, "group": {Args: newGeneric(predictGroups, 1, 2)},
"start": {Args: newGeneric(predictGroups, 1)},
"run": {Args: newGeneric(predictGroups, 1)},
},
},
"apps": {
Sub: complete.Commands{
"address": {Args: newGeneric(predictApps, 1)}, "url": {Args: newGeneric(predictApps, 1)},
"destroy": {Args: newGeneric(predictApps, 1)}, "delete": {Args: newGeneric(predictApps, 1)},
"exec": {Args: newGeneric(predictApps, 1)},
"list": {}, "available": {},
"logs": {Args: newGeneric(predictApps, 1)}, "log": {Args: newGeneric(predictApps, 1)},
"restart": {Args: newGeneric(predictApps, 1)},
"run": {Args: newGeneric(predictApps, 1)},
"config": {Args: newGeneric(predictApps, 1)},
"start": {Args: newGeneric(predictApps, 1)}, "up": {Args: newGeneric(predictApps, 1)},
"status": {Args: newGeneric(predictApps, 1)}, "ps": {Args: newGeneric(predictApps, 1)},
"stop": {Args: newGeneric(predictApps, 1)}, "down": {Args: newGeneric(predictApps, 1)},
"update": {Args: newGeneric(predictApps, 1)}, "upgrade": {Args: newGeneric(predictApps, 1)},
},
},
"shell": {}, "sh": {}, "cmd": {},
"tip": {},
"update": {}, "upgrade": {},
"changelog": {}, "changes": {},
},
GlobalFlags: complete.Flags{
"-h": complete.PredictNothing,
"--help": complete.PredictNothing,
"-v": complete.PredictNothing,
"--version": complete.PredictNothing,
},
}
func main() {
complete.New("dab", dab).Run()
}