aboutsummaryrefslogtreecommitdiff
path: root/cmd/app/main.go
blob: dcd3eb069a49f1f97902c19810ec0d2a3e55373f (plain) (blame)
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
package main

import (
	"log"
	"os"

	"github.com/urfave/cli/v2"
	"sh.org.ru/cmd/app/importer"
	"sh.org.ru/cmd/app/serve"
)

func main() {
	app := &cli.App{
		Name: "app",
		Commands: []*cli.Command{
			{
				Name:   "serve",
				Action: serve.Run,
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "config",
						Value: "./config/dev.yaml",
						Usage: "config",
					},
				},
			},
			{
				Name:   "import",
				Action: importer.Run,
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:  "config",
						Value: "./config/dev.yaml",
						Usage: "config",
					},
				},
			},
		},
	}
	if err := app.Run(os.Args); err != nil {
		log.Fatal(err)
	}
}