-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.go
45 lines (40 loc) · 1.29 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
package main
import (
"log"
"os"
"github.com/joho/godotenv"
cli "github.com/urfave/cli/v2"
"github.com/vim-jp/slacklog-generator/subcmd"
"github.com/vim-jp/slacklog-generator/subcmd/buildindex"
"github.com/vim-jp/slacklog-generator/subcmd/fetchchannels"
"github.com/vim-jp/slacklog-generator/subcmd/fetchmessages"
"github.com/vim-jp/slacklog-generator/subcmd/fetchusers"
"github.com/vim-jp/slacklog-generator/subcmd/serve"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Printf("[WARN] failed to load .env files")
}
app := cli.NewApp()
app.EnableBashCompletion = true
app.Name = "slacklog-generator"
app.Usage = "generate slacklog HTML"
app.Version = "0.0.0"
app.Commands = []*cli.Command{
subcmd.ConvertExportedLogsCommand, // "convert-exported-logs"
subcmd.DownloadEmojiCommand, // "download-emoji"
subcmd.DownloadFilesCommand, // "download-files"
subcmd.GenerateHTMLCommand, // "generate-html"
serve.Command, // "serve"
buildindex.NewCLICommand(), // "build-index"
fetchmessages.NewCLICommand(), // "fetch-messages"
fetchchannels.NewCLICommand(), // "fetch-channels"
fetchusers.NewCLICommand(), // "fetch-users"
}
err = app.Run(os.Args)
if err != nil {
log.Printf("[ERROR] %s", err)
os.Exit(1)
}
}