fix: prompt
This commit is contained in:
parent
bcbf672600
commit
7012016884
|
@ -81,7 +81,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *clientVersion;
|
const char *clientVersion;
|
||||||
char brandName[32];
|
char cusName[32];
|
||||||
char promptHeader[32];
|
char promptHeader[32];
|
||||||
const char* promptContinue;
|
const char* promptContinue;
|
||||||
const char* osname;
|
const char* osname;
|
||||||
|
|
|
@ -19,16 +19,16 @@
|
||||||
|
|
||||||
#include "shellInt.h"
|
#include "shellInt.h"
|
||||||
|
|
||||||
#ifndef OEM_BRAND
|
#ifndef CUS_NAME
|
||||||
char brandName[] = "TDengine";
|
char cus_name[] = "TDengine";
|
||||||
#else
|
#else
|
||||||
char brandName[] = OEM_BRAND;
|
char cust_name[] = CUS_NAME;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OEM_PROMPT
|
#ifndef CUS_PROMPT
|
||||||
char brandPrompt[] = "taos";
|
char cusPrompt[] = "taos";
|
||||||
#else
|
#else
|
||||||
char brandPrompt[] = OEM_PROMPT;
|
char cusPrompt[] = CUS_PROMPT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TAOS_CONSOLE_PROMPT_CONTINUE " -> "
|
#define TAOS_CONSOLE_PROMPT_CONTINUE " -> "
|
||||||
|
@ -402,8 +402,8 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
|
||||||
shell.info.clientVersion =
|
shell.info.clientVersion =
|
||||||
"Welcome to the %s Command Line Interface, Client Version:%s\r\n"
|
"Welcome to the %s Command Line Interface, Client Version:%s\r\n"
|
||||||
"Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n";
|
"Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n";
|
||||||
strcpy(shell.info.brandName, brandName);
|
strcpy(shell.info.cusName, cusName);
|
||||||
sprintf(shell.info.promptHeader, "%s> ", brandPrompt);
|
sprintf(shell.info.promptHeader, "%s> ", cusPrompt);
|
||||||
shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE;
|
shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE;
|
||||||
shell.info.promptSize = strlen(shell.info.promptHeader);
|
shell.info.promptSize = strlen(shell.info.promptHeader);
|
||||||
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "version: %s", version);
|
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "version: %s", version);
|
||||||
|
|
|
@ -329,7 +329,7 @@ int cntDel = 0; // delete byte count after next press tab
|
||||||
// show auto tab introduction
|
// show auto tab introduction
|
||||||
void printfIntroduction() {
|
void printfIntroduction() {
|
||||||
printf(" ****************************** Tab Completion **********************************\n");
|
printf(" ****************************** Tab Completion **********************************\n");
|
||||||
printf(" * The %s CLI supports tab completion for a variety of items, *\n", shell.info.brandName);
|
printf(" * The %s CLI supports tab completion for a variety of items, \n", shell.info.cusName);
|
||||||
printf(" * including database names, table names, function names and keywords. *\n");
|
printf(" * including database names, table names, function names and keywords. *\n");
|
||||||
printf(" * The full list of shortcut keys is as follows: *\n");
|
printf(" * The full list of shortcut keys is as follows: *\n");
|
||||||
printf(" * [ TAB ] ...... complete the current word *\n");
|
printf(" * [ TAB ] ...... complete the current word *\n");
|
||||||
|
@ -344,7 +344,7 @@ void printfIntroduction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void showHelp() {
|
void showHelp() {
|
||||||
printf("\nThe %s CLI supports the following commands:", shell.info.brandName);
|
printf("\nThe %s CLI supports the following commands:", shell.info.cusName);
|
||||||
printf(
|
printf(
|
||||||
"\n\
|
"\n\
|
||||||
----- A ----- \n\
|
----- A ----- \n\
|
||||||
|
|
|
@ -1072,8 +1072,8 @@ void *shellThreadLoop(void *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t shellExecute() {
|
int32_t shellExecute() {
|
||||||
printf(shell.info.clientVersion, shell.info.brandName,
|
printf(shell.info.clientVersion, shell.info.cusName,
|
||||||
taos_get_client_info(), shell.info.brandName);
|
taos_get_client_info(), shell.info.cusName);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
SShellArgs *pArgs = &shell.args;
|
SShellArgs *pArgs = &shell.args;
|
||||||
|
|
Loading…
Reference in New Issue