-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
executable file
·51 lines (42 loc) · 1.2 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
package main
import (
"ch/kirari04/videocms/cmd"
"fmt"
"github.com/thatisuday/commando"
)
func main() {
commando.
SetExecutableName("videocms").
SetVersion("v1.0.0").
SetDescription("Videocms cli - To manage your instances.")
commando.
Register(nil).
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
fmt.Println("try the help command")
})
commando.
Register("serve:main").
SetShortDescription("starts the main server").
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
cmd.ServeMain()
})
commando.
Register("config").
SetShortDescription("prints the current configuration").
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
cmd.Config()
})
commando.
Register("create:user").
SetShortDescription("creates a new user").
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
cmd.CreateUser()
})
commando.
Register("delete:user").
SetShortDescription("delete a user").
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
cmd.DeleteUser()
})
commando.Parse(nil)
}