提交 9b3c4de4 编写于 作者: S slguan

show client version info before connecting to server

上级 8b05ac99
......@@ -33,9 +33,8 @@
#include "tutil.h"
/**************** Global variables ****************/
char VERSION_INFO[] =
"Welcome to the TDengine shell, server version:%s client version:%s\n"
"Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n";
char CLIENT_VERSION[] = "Welcome to the TDengine shell, client version:%s ";
char SERVER_VERSION[] = "server version:%s\nCopyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n";
char PROMPT_HEADER[] = "taos> ";
char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 6;
......@@ -46,6 +45,10 @@ History history;
* FUNCTION: Initialize the shell.
*/
TAOS *shellInit(struct arguments *args) {
printf("\n");
printf(CLIENT_VERSION, taos_get_client_info());
fflush(stdout);
// set options before initializing
if (args->timezone != NULL) {
taos_options(TSDB_OPTION_TIMEZONE, args->timezone);
......@@ -100,8 +103,7 @@ TAOS *shellInit(struct arguments *args) {
exit(EXIT_SUCCESS);
}
printf("\n");
printf(VERSION_INFO, taos_get_server_info(con), taos_get_client_info());
printf(SERVER_VERSION, taos_get_server_info(con));
return con;
}
......@@ -584,7 +586,7 @@ void write_history() {
}
void taos_error(TAOS *con) {
fprintf(stderr, "TSDB error: %s\n", taos_errstr(con));
fprintf(stderr, "\nTSDB error: %s\n\n", taos_errstr(con));
/* free local resouce: allocated memory/metric-meta refcnt */
TAOS_RES *pRes = taos_use_result(con);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册