未验证 提交 9001b395 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

fix: improve taos shell user experience for connecting cloud (#20912)

上级 1d48f55e
-DLINUX
-DWEBSOCKET
-I/usr/include
-Iinclude
-Iinclude/os
-Iinclude/common
-Iinclude/util
-Iinclude/libs/transport
-Itools/shell/inc
......@@ -243,8 +243,8 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
SShellArgs *pArgs = &shell.args;
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "--usage") == 0 || strcmp(argv[i], "-?") == 0 ||
strcmp(argv[i], "/?") == 0) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "--usage") == 0
|| strcmp(argv[i], "-?") == 0 || strcmp(argv[i], "/?") == 0) {
shellParseSingleOpt('?', NULL);
return 0;
}
......@@ -260,8 +260,10 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
return -1;
}
if (key[1] == 'h' || key[1] == 'P' || key[1] == 'u' || key[1] == 'a' || key[1] == 'c' || key[1] == 's' ||
key[1] == 'f' || key[1] == 'd' || key[1] == 'w' || key[1] == 'n' || key[1] == 'l' || key[1] == 'N'
if (key[1] == 'h' || key[1] == 'P' || key[1] == 'u'
|| key[1] == 'a' || key[1] == 'c' || key[1] == 's'
|| key[1] == 'f' || key[1] == 'd' || key[1] == 'w'
|| key[1] == 'n' || key[1] == 'l' || key[1] == 'N'
#ifdef WEBSOCKET
|| key[1] == 'E' || key[1] == 'T'
#endif
......@@ -277,10 +279,12 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
}
shellParseSingleOpt(key[1], val);
i++;
} else if (key[1] == 'p' || key[1] == 'A' || key[1] == 'C' || key[1] == 'r' || key[1] == 'k' || key[1] == 't' ||
key[1] == 'V' || key[1] == '?' || key[1] == 1
} else if (key[1] == 'p' || key[1] == 'A' || key[1] == 'C'
|| key[1] == 'r' || key[1] == 'k'
|| key[1] == 't' || key[1] == 'V'
|| key[1] == '?' || key[1] == 1
#ifdef WEBSOCKET
|| key[1] == 'R'
||key[1] == 'R'
#endif
) {
shellParseSingleOpt(key[1], NULL);
......
......@@ -24,7 +24,7 @@ int shell_conn_ws_server(bool first) {
((dsnLen-SHELL_WS_DSN_MASK) > SHELL_WS_DSN_BUFF)?
SHELL_WS_DSN_BUFF:(dsnLen-SHELL_WS_DSN_MASK),
"%s", shell.args.dsn);
fprintf(stdout, "trying to connect %s*** ", cuttedDsn);
fprintf(stdout, "trying to connect %s****** ", cuttedDsn);
fflush(stdout);
for (int i = 0; i < shell.args.timeout; i++) {
shell.ws_conn = ws_connect_with_dsn(shell.args.dsn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册