CLI flags variables renamed.

This commit is contained in:
Alexey Skobkin 2016-03-22 23:12:37 +03:00
parent ac668ee2cd
commit d8646c21a2

View file

@ -11,14 +11,14 @@ import (
) )
func main() { func main() {
var login, password, pointToolsToken string var pointLogin, pointPassword, pointToolsToken string
flag.StringVar(&login, "l", "", "Account login") flag.StringVar(&pointLogin, "l", "", "Account login")
flag.StringVar(&password, "p", "", "Account password") flag.StringVar(&pointPassword, "p", "", "Account password")
flag.StringVar(&pointToolsToken, "t", "", "Point Tools crawler API token") flag.StringVar(&pointToolsToken, "t", "", "Point Tools crawler API token")
flag.Parse() flag.Parse()
if len(login) < 1 || len(password) < 1 { if len(pointLogin) < 1 || len(pointPassword) < 1 {
fmt.Println("Login and password must be defined") fmt.Println("Login and password must be defined")
return return
} }
@ -31,7 +31,7 @@ func main() {
pointClient := point.NewClient("https://point.im/api/") pointClient := point.NewClient("https://point.im/api/")
pointToolsClient := point_tools.NewClient("http://point-tools.local:8000/api/crawler/", pointToolsToken) pointToolsClient := point_tools.NewClient("http://point-tools.local:8000/api/crawler/", pointToolsToken)
_, loginErr := pointClient.Login(login, password) _, loginErr := pointClient.Login(pointLogin, pointPassword)
if loginErr != nil { if loginErr != nil {
fmt.Printf("Login error %s", loginErr) fmt.Printf("Login error %s", loginErr)