1
0
Fork 0

Minor CLI improvements

master
Philip O'Toole 9 months ago
parent 69cc1c504b
commit 6290ad801b

@ -88,20 +88,21 @@ func main() {
return nil
}
connectionStr := fmt.Sprintf("%s://%s:%d", argv.Protocol, argv.Host, argv.Port)
version, err := getVersionWithClient(httpClient, argv)
if err != nil {
msg := err.Error()
if errors.Is(err, syscall.ECONNREFUSED) {
msg = fmt.Sprintf("Unable to connect to rqlited at %s://%s:%d - is it running?",
argv.Protocol, argv.Host, argv.Port)
msg = fmt.Sprintf("Unable to connect to rqlited at %s - is it running?",
connectionStr)
}
ctx.String("%s %v\n", ctx.Color().Red("ERR!"), msg)
return nil
}
fmt.Println("Welcome to the rqlite CLI. Enter \".help\" for usage hints.")
fmt.Printf("Version %s, commit %s, branch %s\n", cmd.Version, cmd.Commit, cmd.Branch)
fmt.Printf("Connected to rqlited version %s\n", version)
fmt.Println("Welcome to the rqlite CLI.")
fmt.Printf("Enter \".help\" for usage hints.\n")
fmt.Printf("Connected to %s running version %s\n", connectionStr, version)
timer := false
consistency := "weak"

Loading…
Cancel
Save