-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
37 lines (30 loc) · 882 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
package main
import (
"flag"
"log"
"strings"
"github.com/jtrotsky/govend/vend"
)
var (
token string
domainPrefix string
tz string
)
func main() {
vend.NewClient(token, domainPrefix, tz)
}
func init() {
log.SetOutput(os.Stderr)
// Get auth and retailer info from command line flags.
flag.StringVar(&domainPrefix, "d", "",
"The Vend store name (prefix of xxxx.vendhq.com)")
flag.StringVar(&token, "t", "",
"Personal API Access Token for the store, generated from Setup -> API Access.")
flag.StringVar(&tz, "z", "Local",
"Timezone of the store in zoneinfo format. The default is to try and use the computer's local timezone.")
flag.Parse()
// To save people who write DomainPrefix.vendhq.com.
// Split DomainPrefix on the "." period character then grab the first part.
parts := strings.Split(domainPrefix, ".")
domainPrefix = parts[0]
}