Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3a0a720e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
3a0a720e
编写于
8月 06, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5844]<feature>: make cmd line parameter similar.
上级
39280a5e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+15
-15
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
3a0a720e
...
...
@@ -77,7 +77,7 @@ extern char configDir[];
#define COL_BUFFER_LEN ((TSDB_COL_NAME_LEN + 15) * TSDB_MAX_COLUMNS)
#define MAX_USERNAME_SIZE 64
#define MAX_PASSWORD_SIZE
64
#define MAX_PASSWORD_SIZE
16
#define MAX_HOSTNAME_SIZE 253 // https://man7.org/linux/man-pages/man7/hostname.7.html
#define MAX_TB_NAME_SIZE 64
#define MAX_DATA_SIZE (16*TSDB_MAX_COLUMNS)+20 // max record len: 16*MAX_COLUMNS, timestamp string and ,('') need extra space
...
...
@@ -216,7 +216,7 @@ typedef struct SArguments_S {
uint16_t
port
;
uint16_t
iface
;
char
*
user
;
char
*
password
;
char
password
[
MAX_PASSWORD_SIZE
]
;
char
*
database
;
int
replica
;
char
*
tb_prefix
;
...
...
@@ -709,24 +709,24 @@ static void printHelp() {
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-u"
,
indent
,
"The TDengine user name to use when connecting to the server. Default is 'root'."
);
#ifdef _TD_POWER_
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
P
"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
p
"
,
indent
,
"The password to use when connecting to the server. Default is 'powerdb'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-c"
,
indent
,
"Configuration directory. Default is '/etc/power/'."
);
#elif (_TD_TQ_ == true)
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
P
"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
p
"
,
indent
,
"The password to use when connecting to the server. Default is 'tqueue'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-c"
,
indent
,
"Configuration directory. Default is '/etc/tq/'."
);
#else
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
P
"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
p
"
,
indent
,
"The password to use when connecting to the server. Default is 'taosdata'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-c"
,
indent
,
"Configuration directory. Default is '/etc/taos/'."
);
#endif
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-h"
,
indent
,
"The host to connect to TDengine. Default is localhost."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
p
"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
P
"
,
indent
,
"The TCP/IP port number to use for the connection. Default is 0."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-I"
,
indent
,
#if STMT_IFACE_ENABLED == 1
...
...
@@ -826,11 +826,11 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
exit
(
EXIT_FAILURE
);
}
arguments
->
host
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-
p
"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-
P
"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-
p
need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-
P
need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
...
...
@@ -860,13 +860,13 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
exit
(
EXIT_FAILURE
);
}
arguments
->
user
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-P need a valid string following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
{
if
(
strlen
(
argv
[
i
])
==
2
)
{
printf
(
"Enter password:"
);
scanf
(
"%s"
,
arguments
->
password
);
}
else
{
tstrncpy
(
arguments
->
password
,
(
char
*
)(
argv
[
i
]
+
2
),
MAX_PASSWORD_SIZE
);
}
arguments
->
password
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-o"
)
==
0
)
{
if
(
argc
==
i
+
1
)
{
printHelp
();
...
...
@@ -1065,7 +1065,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
debug_print
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-gg"
)
==
0
)
{
arguments
->
verbose_print
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-
pp
"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-
PP
"
)
==
0
)
{
arguments
->
performance_print
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-O"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录