提交 40936493 编写于 作者: sangshuduo's avatar sangshuduo

chore: use brand name instead

上级 868cf83c
...@@ -80,8 +80,9 @@ typedef struct { ...@@ -80,8 +80,9 @@ typedef struct {
} SShellArgs; } SShellArgs;
typedef struct { typedef struct {
const char* clientVersion; const char *clientVersion;
const char* promptHeader; char brandName[32];
char promptHeader[32];
const char* promptContinue; const char* promptContinue;
const char* osname; const char* osname;
int32_t promptSize; int32_t promptSize;
......
...@@ -19,7 +19,18 @@ ...@@ -19,7 +19,18 @@
#include "shellInt.h" #include "shellInt.h"
#define TAOS_CONSOLE_PROMPT_HEADER "taos> " #ifndef OEM_BRAND
char brandName[] = "TDengine";
#else
char brandName[] = OEM_BRAND;
#endif
#ifndef OEM_PROMPT
char brandPrompt[] = "taos";
#else
char brandPrompt[] = OEM_PROMPT;
#endif
#define TAOS_CONSOLE_PROMPT_CONTINUE " -> " #define TAOS_CONSOLE_PROMPT_CONTINUE " -> "
#define SHELL_HOST "The server FQDN to connect. The default host is localhost." #define SHELL_HOST "The server FQDN to connect. The default host is localhost."
...@@ -389,11 +400,12 @@ static int32_t shellCheckArgs() { ...@@ -389,11 +400,12 @@ static int32_t shellCheckArgs() {
int32_t shellParseArgs(int32_t argc, char *argv[]) { int32_t shellParseArgs(int32_t argc, char *argv[]) {
shellInitArgs(argc, argv); shellInitArgs(argc, argv);
shell.info.clientVersion = shell.info.clientVersion =
"Welcome to the TDengine Command Line Interface, Client Version:%s\r\n" "Welcome to the %s Command Line Interface, Client Version:%s\r\n"
"Copyright (c) 2022 by TDengine, all rights reserved.\r\n\r\n"; "Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n";
shell.info.promptHeader = TAOS_CONSOLE_PROMPT_HEADER; strcpy(shell.info.brandName, brandName);
sprintf(shell.info.promptHeader, "%s> ", brandPrompt);
shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE; shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE;
shell.info.promptSize = 6; 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);
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
......
...@@ -328,7 +328,7 @@ int cntDel = 0; // delete byte count after next press tab ...@@ -328,7 +328,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 TDengine CLI supports tab completion for a variety of items, *\n"); printf(" * The %s CLI supports tab completion for a variety of items, *\n", shell.info.brandName);
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");
...@@ -343,7 +343,7 @@ void printfIntroduction() { ...@@ -343,7 +343,7 @@ void printfIntroduction() {
} }
void showHelp() { void showHelp() {
printf("\nThe TDengine CLI supports the following commands:"); printf("\nThe %s CLI supports the following commands:", shell.info.brandName);
printf( printf(
"\n\ "\n\
----- A ----- \n\ ----- A ----- \n\
......
...@@ -1072,7 +1072,8 @@ void *shellThreadLoop(void *arg) { ...@@ -1072,7 +1072,8 @@ void *shellThreadLoop(void *arg) {
} }
int32_t shellExecute() { int32_t shellExecute() {
printf(shell.info.clientVersion, taos_get_client_info()); printf(shell.info.clientVersion, shell.info.brandName,
taos_get_client_info(), shell.info.brandName);
fflush(stdout); fflush(stdout);
SShellArgs *pArgs = &shell.args; SShellArgs *pArgs = &shell.args;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册