Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
30b79431
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
30b79431
编写于
12月 10, 2020
作者:
S
stephenkgu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2405]<feature>: new option -C (--dump-config) for taos to dump current configuration
上级
8e949fd1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
0 deletion
+24
-0
src/kit/shell/inc/shell.h
src/kit/shell/inc/shell.h
+1
-0
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+4
-0
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+15
-0
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+4
-0
未找到文件。
src/kit/shell/inc/shell.h
浏览文件 @
30b79431
...
...
@@ -45,6 +45,7 @@ typedef struct SShellArguments {
char
*
timezone
;
bool
is_raw_time
;
bool
is_use_passwd
;
bool
dump_config
;
char
file
[
TSDB_FILENAME_LEN
];
char
dir
[
TSDB_FILENAME_LEN
];
int
threadNum
;
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
30b79431
...
...
@@ -39,6 +39,7 @@ static struct argp_option options[] = {
{
"user"
,
'u'
,
"USER"
,
0
,
"The user name to use when connecting to the server."
},
{
"user"
,
'A'
,
"Auth"
,
0
,
"The user auth to use when connecting to the server."
},
{
"config-dir"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configuration directory."
},
{
"dump-config"
,
'C'
,
0
,
0
,
"Dump configuration."
},
{
"commands"
,
's'
,
"COMMANDS"
,
0
,
"Commands to run without enter the shell."
},
{
"raw-time"
,
'r'
,
0
,
0
,
"Output time as uint64_t."
},
{
"file"
,
'f'
,
"FILE"
,
0
,
"Script to run without enter the shell."
},
...
...
@@ -96,6 +97,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
tstrncpy
(
configDir
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
wordfree
(
&
full_path
);
break
;
case
'C'
:
arguments
->
dump_config
=
true
;
break
;
case
's'
:
arguments
->
commands
=
arg
;
break
;
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
30b79431
...
...
@@ -15,6 +15,7 @@
#include "os.h"
#include "shell.h"
#include "tconfig.h"
#include "tnettest.h"
pthread_t
pid
;
...
...
@@ -58,6 +59,7 @@ SShellArguments args = {
.
timezone
=
NULL
,
.
is_raw_time
=
false
,
.
is_use_passwd
=
false
,
.
dump_config
=
false
,
.
file
=
"
\0
"
,
.
dir
=
"
\0
"
,
.
threadNum
=
5
,
...
...
@@ -78,6 +80,19 @@ int main(int argc, char* argv[]) {
shellParseArgument
(
argc
,
argv
,
&
args
);
if
(
args
.
dump_config
)
{
taosInitGlobalCfg
();
taosReadGlobalLogCfg
();
if
(
!
taosReadGlobalCfg
())
{
printf
(
"TDengine read global config failed"
);
exit
(
EXIT_FAILURE
);
}
taosDumpGlobalCfg
();
exit
(
0
);
}
if
(
args
.
netTestRole
&&
args
.
netTestRole
[
0
]
!=
0
)
{
taos_init
();
taosNetTest
(
args
.
netTestRole
,
args
.
host
,
args
.
port
,
args
.
pktLen
);
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
30b79431
...
...
@@ -35,6 +35,8 @@ void printHelp() {
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The user auth to use when connecting to the server."
);
printf
(
"%s%s
\n
"
,
indent
,
"-c"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Configuration directory."
);
printf
(
"%s%s
\n
"
,
indent
,
"-C"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Dump configuration."
);
printf
(
"%s%s
\n
"
,
indent
,
"-s"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Commands to run without enter the shell."
);
printf
(
"%s%s
\n
"
,
indent
,
"-r"
);
...
...
@@ -104,6 +106,8 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
fprintf
(
stderr
,
"Option -c requires an argument
\n
"
);
exit
(
EXIT_FAILURE
);
}
}
else
if
(
strcmp
(
argv
[
i
],
"-C"
)
==
0
)
{
arguments
->
dump_config
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-s"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
arguments
->
commands
=
argv
[
++
i
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录