feat: version2 modify tip msg
This commit is contained in:
parent
1e7cfefc5e
commit
987e0b845f
|
@ -41,6 +41,9 @@ void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb);
|
||||||
// introduction
|
// introduction
|
||||||
void printfIntroduction();
|
void printfIntroduction();
|
||||||
|
|
||||||
|
// show enterprise AD at start or end
|
||||||
|
void showAD(bool end);
|
||||||
|
|
||||||
// show all commands help
|
// show all commands help
|
||||||
void showHelp();
|
void showHelp();
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ SMatch* lastMatch = NULL; // save last match result
|
||||||
int cntDel = 0; // delete byte count after next press tab
|
int cntDel = 0; // delete byte count after next press tab
|
||||||
|
|
||||||
// show auto tab introduction
|
// show auto tab introduction
|
||||||
void printfIntroduction() {
|
void printfIntroduction(bool community) {
|
||||||
printf(" ******************************** Tab Completion ************************************\n");
|
printf(" ******************************** Tab Completion ************************************\n");
|
||||||
char secondLine[160] = "\0";
|
char secondLine[160] = "\0";
|
||||||
sprintf(secondLine, " * The %s CLI supports tab completion for a variety of items, ", shell.info.cusName);
|
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 + L ] ...... clear the entire screen *\n");
|
||||||
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) {
|
||||||
|
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");
|
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() {
|
void showHelp() {
|
||||||
printf("\nThe %s CLI supports the following commands:", shell.info.cusName);
|
printf("\nThe %s CLI supports the following commands:", shell.info.cusName);
|
||||||
printf(
|
printf(
|
||||||
|
|
|
@ -1150,15 +1150,6 @@ void shellSourceFile(const char *file) {
|
||||||
taosCloseFile(&pFile);
|
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 shellGetGrantInfo() {
|
||||||
bool community = true;
|
bool community = true;
|
||||||
char sinfo[1024] = {0};
|
char sinfo[1024] = {0};
|
||||||
|
@ -1205,7 +1196,6 @@ bool shellGetGrantInfo() {
|
||||||
|
|
||||||
if (strcmp(serverVersion, "community") == 0) {
|
if (strcmp(serverVersion, "community") == 0) {
|
||||||
community = true;
|
community = true;
|
||||||
showAD();
|
|
||||||
} 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(stdout, "Server is Enterprise %s Edition, %s and will never expire.\r\n", serverVersion, sinfo);
|
||||||
|
@ -1378,10 +1368,15 @@ 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();
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
printfIntroduction();
|
printfIntroduction(community);
|
||||||
|
#else
|
||||||
|
if(community) {
|
||||||
|
showAD(false)
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
bool community = shellGetGrantInfo();
|
|
||||||
#ifdef WEBSOCKET
|
#ifdef WEBSOCKET
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1397,7 +1392,7 @@ int32_t shellExecute() {
|
||||||
|
|
||||||
// commnuity
|
// commnuity
|
||||||
if (community) {
|
if (community) {
|
||||||
showAD();
|
showAD(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosThreadJoin(spid, NULL);
|
taosThreadJoin(spid, NULL);
|
||||||
|
|
Loading…
Reference in New Issue