-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.go
45 lines (42 loc) · 1.18 KB
/
cli.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 app
import (
"github.com/geocodio/geocodio-cli/create"
"github.com/geocodio/geocodio-cli/download"
"github.com/geocodio/geocodio-cli/list"
"github.com/geocodio/geocodio-cli/release"
"github.com/geocodio/geocodio-cli/remove"
"github.com/geocodio/geocodio-cli/status"
"github.com/urfave/cli/v2"
)
func BuildApp() *cli.App {
app := cli.NewApp()
app.Name = "Geocodio"
app.Usage = "Geocode lists using the Geocodio API"
app.Version = release.Version()
app.EnableBashCompletion = true
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "hostname",
Aliases: []string{"n"},
Value: "api.geocod.io",
Usage: "Geocodio hostname to use, change this for Geocodio+HIPAA or on-premise environments",
EnvVars: []string{"GEOCODIO_HOSTNAME"},
},
&cli.StringFlag{
Name: "apikey",
Aliases: []string{"k"},
Value: "",
Usage: "Geocodio API Key to use. Generate a new one in the Geocodio Dashboard",
EnvVars: []string{"GEOCODIO_API_KEY"},
Required: true,
},
}
app.Commands = []*cli.Command{
create.RegisterCommand(),
list.RegisterCommand(),
status.RegisterCommand(),
remove.RegisterCommand(),
download.RegisterCommand(),
}
return app
}