// Words to add to dictionary for a workspace.
"cSpell.words": [
"apiv", "iosk", "zhouhui", "ldflags", "socketio", "xdsconfig", "sdkid",
- "godotenv", "crosssdk", "prjs", "xaapiv", "urfave"
+ "godotenv", "crosssdk", "prjs", "xaapiv", "urfave", "sebd", "golib",
+ "joho", "XDSAGENT"
]
}
}
writer := NewTableWriter()
- fmt.Fprintln(writer, "Agent ID:\t", ver.Client.ID)
+ fmt.Fprintln(writer, "Agent:")
+ fmt.Fprintln(writer, " ID:\t", ver.Client.ID)
v := ver.Client.Version
if verbose {
v += " (" + ver.Client.VersionGitTag + ")"
}
for _, svr := range ver.Server {
- fmt.Fprintln(writer, "Server ID:\t", svr.ID)
+ fmt.Fprintln(writer, "Server:")
+ fmt.Fprintln(writer, " ID:\t", svr.ID)
v = svr.Version
if verbose {
v += " (" + svr.VersionGitTag + ")"
Value: defaultLogLevel,
},
cli.StringFlag{
- Name: "url",
+ Name: "url, u",
EnvVar: "XDS_SERVER_URL",
Value: "localhost:8000",
Usage: "remote XDS server url",
// Define HTTP and WS url
baseURL := ctx.String("url")
- if !strings.HasPrefix(ctx.String("url"), "http://") {
- baseURL = "http://" + ctx.String("url")
+
+ // Allow to only set port number
+ if match, _ := regexp.MatchString("^([0-9]+)$", baseURL); match {
+ baseURL = "http://localhost:" + ctx.String("url")
+ }
+
+ // Add http prefix if missing
+ if !strings.HasPrefix(baseURL, "http://") {
+ baseURL = "http://" + baseURL
}
// Create HTTP client