-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (34 loc) · 1.21 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
package main
import (
"fmt"
"github.com/bigopenworld/fastset/framework"
"github.com/bigopenworld/fastset/install"
"github.com/bigopenworld/fastset/logger"
"github.com/thatisuday/commando"
)
func main() {
logger.Init()
commando.
SetExecutableName("fastset").
SetVersion("v1.0.0").
SetDescription("A cli that help you create project initial files faster")
commando.
Register("framework").
AddArgument("framework", "the name of the framework that you want to use", "").
AddArgument("name", "the name of your project", "").
AddFlag("verbose, V", "display log information", commando.Bool, nil).
SetAction(framework.Select)
commando.
Register("lang").
AddArgument("lang", "the name of the lang that you want to use", "").
AddFlag("verbose, V", "display log information", commando.Bool, nil).
SetAction(func(args map[string]commando.ArgValue, flags map[string]commando.FlagValue) {
fmt.Println(args["framework"].Value)
})
commando.
Register("install").
AddArgument("packagename", "the name of the lang that you want to use (all => list all the avaliable stable install)", "all").
AddFlag("verbose, V", "display log information", commando.Bool, nil).
SetAction(install.Select)
commando.Parse(nil)
}