-
Notifications
You must be signed in to change notification settings - Fork 156
/
main.go
44 lines (37 loc) · 949 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
39
40
41
42
43
44
// Copyright 2015 ASoulDocs. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// ASoulDocs is a stupid web server for multilingual documentation.
package main
import (
"os"
"github.com/urfave/cli"
log "unknwon.dev/clog/v2"
"github.com/asoul-sig/asouldocs/internal/cmd"
"github.com/asoul-sig/asouldocs/internal/conf"
)
func init() {
conf.App.Version = "1.0.0+dev"
}
func main() {
version := conf.App.Version
if conf.BuildVersion != "" {
version = conf.BuildVersion
}
if conf.BuildCommit != "" {
version += "-" + conf.BuildCommit
}
if conf.BuildTime != "" {
version += "@" + conf.BuildTime
}
app := cli.NewApp()
app.Name = "ASoulDocs"
app.Usage = "Ellien's documentation server"
app.Version = version
app.Commands = []cli.Command{
cmd.Web,
}
if err := app.Run(os.Args); err != nil {
log.Fatal("Failed to start application: %v", err)
}
}