fix: last modify information

This commit is contained in:
Alex Duan 2024-03-13 20:36:43 +08:00
parent 987e0b845f
commit cca0bf6af0
3 changed files with 18 additions and 14 deletions

View File

@ -39,7 +39,7 @@ void shellAutoExit();
void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb); void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb);
// introduction // introduction
void printfIntroduction(); void printfIntroduction(bool community);
// show enterprise AD at start or end // show enterprise AD at start or end
void showAD(bool end); void showAD(bool end);

View File

@ -421,21 +421,20 @@ void printfIntroduction(bool community) {
printf(" * [ Ctrl + K ] ...... clear the screen after the cursor *\n"); printf(" * [ Ctrl + K ] ...... clear the screen after the cursor *\n");
printf(" * [ Ctrl + U ] ...... clear the screen before the cursor *\n"); printf(" * [ Ctrl + U ] ...... clear the screen before the cursor *\n");
if(community) { if(community) {
printf(" * ----------------------------------------------------------------------------- *\n"); printf(" * ---------------------------------------------------------------------------------- *\n");
printf(" * You are using TDengine OSS. To experience more advanced TDengine features and *\n"); printf(" * You are using TDengine OSS. To experience more advanced features and receive *\n");
printf(" * receive professional technical support, try TDengine Enterprise: *\n"); printf(" * professional technical support, try TDengine Enterprise or Cloud, *\n");
printf(" * http://www.tdengine.com *\n"); printf(" * learn more at https://tdengine.com *\n");
} }
printf(" **************************************************************************************\n\n"); printf(" **************************************************************************************\n\n");
} }
// show enterprise AD // show enterprise AD
void showAD(bool end) { void showAD(bool end) {
printf("\n"); printf(" You are using TDengine OSS. To experience more advanced features and receive \n");
printf(" You are using TDengine OSS. To experience more advanced TDengine features and \n"); printf(" professional technical support, try TDengine Enterprise or Cloud, \n");
printf(" receive professional technical support, try TDengine Enterprise: \n"); printf(" learn more at https://tdengine.com \n");
printf(" http://www.tdengine.com \n"); printf(" \n");
printf("\n");
} }
void showHelp() { void showHelp() {

View File

@ -1150,7 +1150,7 @@ void shellSourceFile(const char *file) {
taosCloseFile(&pFile); taosCloseFile(&pFile);
} }
bool shellGetGrantInfo() { bool shellGetGrantInfo(char* buf) {
bool community = true; bool community = true;
char sinfo[1024] = {0}; char sinfo[1024] = {0};
tstrncpy(sinfo, taos_get_server_info(shell.conn), sizeof(sinfo)); tstrncpy(sinfo, taos_get_server_info(shell.conn), sizeof(sinfo));
@ -1198,10 +1198,10 @@ bool shellGetGrantInfo() {
community = true; community = true;
} else if (strcmp(expiretime, "unlimited") == 0) { } else if (strcmp(expiretime, "unlimited") == 0) {
community = false; community = false;
fprintf(stdout, "Server is Enterprise %s Edition, %s and will never expire.\r\n", serverVersion, sinfo); fprintf(buf, "Server is Enterprise %s Edition, %s and will never expire.\r\n", serverVersion, sinfo);
} else { } else {
community = false; community = false;
fprintf(stdout, "Server is Enterprise %s Edition, %s and will expire at %s.\r\n", serverVersion, sinfo, fprintf(buf, "Server is Enterprise %s Edition, %s and will expire at %s.\r\n", serverVersion, sinfo,
expiretime); expiretime);
} }
@ -1368,7 +1368,8 @@ int32_t shellExecute() {
#ifdef WEBSOCKET #ifdef WEBSOCKET
if (!shell.args.restful && !shell.args.cloud) { if (!shell.args.restful && !shell.args.cloud) {
#endif #endif
bool community = shellGetGrantInfo(); char buf[512] = "";
bool community = shellGetGrantInfo(buf);
#ifndef WINDOWS #ifndef WINDOWS
printfIntroduction(community); printfIntroduction(community);
#else #else
@ -1376,6 +1377,10 @@ bool community = shellGetGrantInfo();
showAD(false) showAD(false)
} }
#endif #endif
// printf version
if(!community) {
printf(buf);
}
#ifdef WEBSOCKET #ifdef WEBSOCKET
} }