Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
236af263
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
236af263
编写于
2月 04, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2931] <feature>: add -y parameter to skip prompt.
上级
0bdecede
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
3 deletion
+18
-3
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+18
-3
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
236af263
...
...
@@ -67,6 +67,7 @@ typedef struct DemoArguments {
char
*
sqlFile
;
bool
use_metric
;
bool
insert_only
;
bool
answer_yes
;
char
*
output_file
;
int
mode
;
char
*
datatype
[
MAX_NUM_DATATYPE
+
1
];
...
...
@@ -114,6 +115,7 @@ typedef struct DemoArguments {
{
0
,
'c'
,
"config_directory"
,
0
,
"Configuration directory. Default is '/etc/taos/'."
,
14
},
#endif
{
0
,
'x'
,
0
,
0
,
"Insert only flag."
,
13
},
{
0
,
'y'
,
0
,
0
,
"Default input yes for prompt"
,
13
},
{
0
,
'O'
,
"order"
,
0
,
"Insert mode--0: In order, 1: Out of order. Default is in order."
,
14
},
{
0
,
'R'
,
"rate"
,
0
,
"Out of order data's rate--if order=1 Default 10, min: 0, max: 50."
,
14
},
{
0
,
'D'
,
"delete table"
,
0
,
"Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database"
,
14
},
...
...
@@ -210,6 +212,9 @@ typedef struct DemoArguments {
case
'x'
:
arguments
->
insert_only
=
true
;
break
;
case
'y'
:
arguments
->
answer_yes
=
true
;
break
;
case
'c'
:
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
fprintf
(
stderr
,
"Invalid path %s
\n
"
,
arg
);
...
...
@@ -328,6 +333,8 @@ typedef struct DemoArguments {
#endif
printf
(
"%s%s
\n
"
,
indent
,
"-x"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"flag, Insert only flag."
);
printf
(
"%s%s
\n
"
,
indent
,
"-y"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"flag, Anser Yes for prompt."
);
printf
(
"%s%s
\n
"
,
indent
,
"-O"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"order, Insert mode--0: In order, 1: Out of order. Default is in order."
);
printf
(
"%s%s
\n
"
,
indent
,
"-R"
);
...
...
@@ -409,6 +416,8 @@ typedef struct DemoArguments {
arguments
->
use_metric
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-x"
)
==
0
)
{
arguments
->
insert_only
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-y"
)
==
0
)
{
arguments
->
answer_yes
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
strcpy
(
configDir
,
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-O"
)
==
0
)
{
...
...
@@ -549,6 +558,7 @@ int main(int argc, char *argv[]) {
NULL
,
false
,
// use_metric
false
,
// insert_only
false
,
// answer_yes
"./output.txt"
,
// output_file
0
,
// mode
{
...
...
@@ -584,6 +594,7 @@ int main(int argc, char *argv[]) {
arguments
.
num_of_RPR
=
1000
;
arguments
.
use_metric
=
true
;
arguments
.
insert_only
=
false
;
arguments
.
answer_yes
=
false
;
// end change
parse_args
(
argc
,
argv
,
&
arguments
);
...
...
@@ -606,6 +617,7 @@ int main(int argc, char *argv[]) {
int
nrecords_per_request
=
arguments
.
num_of_RPR
;
bool
use_metric
=
arguments
.
use_metric
;
bool
insert_only
=
arguments
.
insert_only
;
bool
answer_yes
=
arguments
.
answer_yes
;
char
**
data_type
=
arguments
.
datatype
;
int
count_data_type
=
0
;
char
dataString
[
STRING_LEN
];
...
...
@@ -666,9 +678,12 @@ int main(int argc, char *argv[]) {
printf
(
"# Delete method: %d
\n
"
,
method_of_delete
);
printf
(
"# Test time: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
printf
(
"###################################################################
\n\n
"
);
printf
(
"Press enter key to continue"
);
(
void
)
getchar
();
if
(
!
answer_yes
)
{
printf
(
"###################################################################
\n\n
"
);
printf
(
"Press enter key to continue"
);
(
void
)
getchar
();
}
fprintf
(
fp
,
"###################################################################
\n
"
);
fprintf
(
fp
,
"# Server IP: %s:%hu
\n
"
,
ip_addr
==
NULL
?
"localhost"
:
ip_addr
,
port
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录