Last active
November 9, 2018 18:05
-
-
Save ali-ince/c29d71535b62cb5e05ea8a2518b3fd75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"os" | |
"github.com/neo4j/neo4j-go-driver/neo4j" | |
) | |
var ( | |
uri string | |
username string | |
password string | |
query string | |
) | |
func main() { | |
if !parseAndVerifyFlags() { | |
os.Exit(-1) | |
} | |
os.Exit(0) | |
} | |
func parseAndVerifyFlags() bool { | |
flag.Parse() | |
if uri == "" || username == "" || password == "" || query == "" { | |
flag.Usage() | |
return false | |
} | |
return true | |
} | |
func init() { | |
flag.StringVar(&uri, "uri", "bolt://localhost", "the bolt uri to connect to") | |
flag.StringVar(&username, "username", "neo4j", "the database username") | |
flag.StringVar(&password, "password", "", "the database password") | |
flag.StringVar(&query, "query", "", "the query to execute") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment