mirror of
https://bitbucket.org/skobkin/point-tools-crawler.git
synced 2024-12-05 02:25:53 +00:00
CLI flags variables renamed.
This commit is contained in:
parent
ac668ee2cd
commit
d8646c21a2
|
@ -11,14 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
var login, password, pointToolsToken string
|
||||
var pointLogin, pointPassword, pointToolsToken string
|
||||
|
||||
flag.StringVar(&login, "l", "", "Account login")
|
||||
flag.StringVar(&password, "p", "", "Account password")
|
||||
flag.StringVar(&pointLogin, "l", "", "Account login")
|
||||
flag.StringVar(&pointPassword, "p", "", "Account password")
|
||||
flag.StringVar(&pointToolsToken, "t", "", "Point Tools crawler API token")
|
||||
flag.Parse()
|
||||
|
||||
if len(login) < 1 || len(password) < 1 {
|
||||
if len(pointLogin) < 1 || len(pointPassword) < 1 {
|
||||
fmt.Println("Login and password must be defined")
|
||||
return
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func main() {
|
|||
pointClient := point.NewClient("https://point.im/api/")
|
||||
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 {
|
||||
fmt.Printf("Login error %s", loginErr)
|
||||
|
|
Loading…
Reference in a new issue