-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (32 loc) · 804 Bytes
/
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
package main
import (
"encoder/app"
"encoder/server"
"encoder/setup"
"fmt"
"github.com/thatisuday/commando"
)
func main() {
commando.
SetExecutableName("Convertarr").
SetVersion("v1.0.0").
SetDescription("This CLI tool encodes all mkv files.")
commando.
Register(nil).
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
fmt.Println("use help command")
})
commando.
Register("serve").
SetShortDescription("start webserver on :8080").
AddFlag("dev", "use temporary database", commando.Bool, false).
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
dev, _ := flags["dev"].GetBool()
if dev {
app.TemporaryDb = true
}
setup.Setup()
server.Serve()
})
commando.Parse(nil)
}