-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (43 loc) · 897 Bytes
/
main.go
File metadata and controls
46 lines (43 loc) · 897 Bytes
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
package main
import (
"fmt"
"os"
"github.com/ecray/avdb-cli/cmd/group"
"github.com/ecray/avdb-cli/cmd/host"
"github.com/ecray/avdb-cli/cmd/tag"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "avdb-cli"
app.Usage = "manage AVDB"
app.Version = "0.2.0"
app.Authors = []cli.Author{
cli.Author{
Name: "Eric Raymond",
Email: "ecraymond@gmail.com",
},
}
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "t, token",
Usage: "server auth token",
EnvVar: "AVDB_TOKEN",
},
cli.StringFlag{
Name: "s, server",
Usage: "server address",
Value: "http://127.0.0.1:3000",
EnvVar: "AVDB_SERVER",
},
}
app.Commands = []cli.Command{
host.Command,
group.Command,
tag.Command,
}
app.CommandNotFound = func(c *cli.Context, command string) {
fmt.Fprintf(c.App.Writer, "Command %q not found!\n", command)
}
app.Run(os.Args)
}