/
dufu.go
49 lines (42 loc) · 1.06 KB
/
dufu.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
package main
import (
"os"
"runtime"
"github.com/codegangsta/cli"
"github.com/futurespace/dufu/cmd/build"
"github.com/futurespace/dufu/cmd/serve"
)
const APP_VER = "0.0.0"
var app = cli.NewApp()
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
app.Name = "Dufu"
app.Usage = "A fast, pluggable static site generator"
app.Version = APP_VER
app.Author = "fundon"
app.Email = "cfddream@gmail.com"
app.Commands = []cli.Command{
cli.Command{
Name: "build",
//ShortName: "b",
Usage: "Build your site",
Action: build.Action,
},
cli.Command{
Name: "serve",
Usage: "Start a serve",
Action: serve.Action,
Flags: []cli.Flag{
cli.StringFlag{"port, p", "8080", "Server's port (defaults to 8080)"},
},
},
}
app.Flags = []cli.Flag{
cli.StringFlag{"source, s", "src", "Source directory (defaults to ./src)"},
cli.StringFlag{"destination, d", "build", "Destination directory (defaults to ./build)"},
cli.StringFlag{"config, c", "", "Custom configuration file (defaults to config.yml|toml|json)"},
}
}
func main() {
app.Run(os.Args)
}