show client version info before connecting to server
This commit is contained in:
parent
8b05ac9960
commit
9b3c4de4c5
|
@ -33,9 +33,8 @@
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
|
||||||
/**************** Global variables ****************/
|
/**************** Global variables ****************/
|
||||||
char VERSION_INFO[] =
|
char CLIENT_VERSION[] = "Welcome to the TDengine shell, client version:%s ";
|
||||||
"Welcome to the TDengine shell, server version:%s client version:%s\n"
|
char SERVER_VERSION[] = "server version:%s\nCopyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n";
|
||||||
"Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n";
|
|
||||||
char PROMPT_HEADER[] = "taos> ";
|
char PROMPT_HEADER[] = "taos> ";
|
||||||
char CONTINUE_PROMPT[] = " -> ";
|
char CONTINUE_PROMPT[] = " -> ";
|
||||||
int prompt_size = 6;
|
int prompt_size = 6;
|
||||||
|
@ -46,6 +45,10 @@ History history;
|
||||||
* FUNCTION: Initialize the shell.
|
* FUNCTION: Initialize the shell.
|
||||||
*/
|
*/
|
||||||
TAOS *shellInit(struct arguments *args) {
|
TAOS *shellInit(struct arguments *args) {
|
||||||
|
printf("\n");
|
||||||
|
printf(CLIENT_VERSION, taos_get_client_info());
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
// set options before initializing
|
// set options before initializing
|
||||||
if (args->timezone != NULL) {
|
if (args->timezone != NULL) {
|
||||||
taos_options(TSDB_OPTION_TIMEZONE, args->timezone);
|
taos_options(TSDB_OPTION_TIMEZONE, args->timezone);
|
||||||
|
@ -100,8 +103,7 @@ TAOS *shellInit(struct arguments *args) {
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf(SERVER_VERSION, taos_get_server_info(con));
|
||||||
printf(VERSION_INFO, taos_get_server_info(con), taos_get_client_info());
|
|
||||||
|
|
||||||
return con;
|
return con;
|
||||||
}
|
}
|
||||||
|
@ -584,7 +586,7 @@ void write_history() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void taos_error(TAOS *con) {
|
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 */
|
/* free local resouce: allocated memory/metric-meta refcnt */
|
||||||
TAOS_RES *pRes = taos_use_result(con);
|
TAOS_RES *pRes = taos_use_result(con);
|
||||||
|
|
Loading…
Reference in New Issue