diff --git a/tools/shell/inc/shellAuto.h b/tools/shell/inc/shellAuto.h index 6a317fe5c9..a4fca51ee7 100644 --- a/tools/shell/inc/shellAuto.h +++ b/tools/shell/inc/shellAuto.h @@ -41,6 +41,9 @@ void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb); // introduction void printfIntroduction(); +// show enterprise AD at start or end +void showAD(bool end); + // show all commands help void showHelp(); diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 847bbcf4be..5fdbbe1be7 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -400,7 +400,7 @@ SMatch* lastMatch = NULL; // save last match result int cntDel = 0; // delete byte count after next press tab // show auto tab introduction -void printfIntroduction() { +void printfIntroduction(bool community) { printf(" ******************************** Tab Completion ************************************\n"); char secondLine[160] = "\0"; sprintf(secondLine, " * The %s CLI supports tab completion for a variety of items, ", shell.info.cusName); @@ -420,9 +420,24 @@ void printfIntroduction() { printf(" * [ Ctrl + L ] ...... clear the entire screen *\n"); printf(" * [ Ctrl + K ] ...... clear the screen after the cursor *\n"); printf(" * [ Ctrl + U ] ...... clear the screen before the cursor *\n"); + if(community) { + printf(" * ----------------------------------------------------------------------------- *\n"); + printf(" * You are using TDengine OSS. To experience more advanced TDengine features and *\n"); + printf(" * receive professional technical support, try TDengine Enterprise: *\n"); + printf(" * http://www.tdengine.com *\n"); + } printf(" **************************************************************************************\n\n"); } +// show enterprise AD +void showAD(bool end) { + printf("\n"); + printf(" You are using TDengine OSS. To experience more advanced TDengine features and \n"); + printf(" receive professional technical support, try TDengine Enterprise: \n"); + printf(" http://www.tdengine.com \n"); + printf("\n"); +} + void showHelp() { printf("\nThe %s CLI supports the following commands:", shell.info.cusName); printf( diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 4b1fc3ba2a..512f188fba 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -1150,15 +1150,6 @@ void shellSourceFile(const char *file) { taosCloseFile(&pFile); } -// show enterprise AD -void showAD() { - fprintf(stdout, "\r\n\ - You are using the TDengine Community Edition. \r\n\ - If you want to experience more advanced TDengine features and have professional service,\r\n\ - please try the TDengine Enterprise Edition.\r\n\ - https://www.taosdata.com/tdengine-enterprise\r\n\r\n"); -} - bool shellGetGrantInfo() { bool community = true; char sinfo[1024] = {0}; @@ -1205,7 +1196,6 @@ bool shellGetGrantInfo() { if (strcmp(serverVersion, "community") == 0) { community = true; - showAD(); } else if (strcmp(expiretime, "unlimited") == 0) { community = false; fprintf(stdout, "Server is Enterprise %s Edition, %s and will never expire.\r\n", serverVersion, sinfo); @@ -1378,10 +1368,15 @@ int32_t shellExecute() { #ifdef WEBSOCKET if (!shell.args.restful && !shell.args.cloud) { #endif +bool community = shellGetGrantInfo(); #ifndef WINDOWS - printfIntroduction(); + printfIntroduction(community); +#else + if(community) { + showAD(false) + } #endif - bool community = shellGetGrantInfo(); + #ifdef WEBSOCKET } #endif @@ -1397,7 +1392,7 @@ int32_t shellExecute() { // commnuity if (community) { - showAD(); + showAD(true); } taosThreadJoin(spid, NULL);