Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1c659a1c
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看板
提交
1c659a1c
编写于
8月 19, 2021
作者:
sangshuduo
提交者:
Shuduo Sang
8月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cherry pick with
d6bfe443
上级
03c3d1aa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
19 deletion
+47
-19
src/kit/shell/src/shellDarwin.c
src/kit/shell/src/shellDarwin.c
+8
-2
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+12
-7
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+8
-2
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+19
-8
未找到文件。
src/kit/shell/src/shellDarwin.c
浏览文件 @
1c659a1c
...
...
@@ -81,19 +81,25 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
}
// for password
else
if
(
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
{
else
if
((
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
strcpy
(
tsOsName
,
"Darwin"
);
printf
(
DARWINCLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
if
(
strlen
(
argv
[
i
])
==
2
)
{
if
((
strlen
(
argv
[
i
])
==
2
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
printf
(
"Enter password: "
);
taosSetConsoleEcho
(
false
);
if
(
scanf
(
"%s"
,
g_password
)
>
1
)
{
fprintf
(
stderr
,
"password read error
\n
"
);
}
taosSetConsoleEcho
(
true
);
getchar
();
}
else
{
tstrncpy
(
g_password
,
(
char
*
)(
argv
[
i
]
+
2
),
SHELL_MAX_PASSWORD_LEN
);
}
arguments
->
password
=
g_password
;
strcpy
(
argv
[
i
],
""
);
argc
-=
1
;
}
// for management port
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
1c659a1c
...
...
@@ -47,8 +47,8 @@ static struct argp_option options[] = {
{
"thread"
,
'T'
,
"THREADNUM"
,
0
,
"Number of threads when using multi-thread to import data."
},
{
"check"
,
'k'
,
"CHECK"
,
0
,
"Check tables."
},
{
"database"
,
'd'
,
"DATABASE"
,
0
,
"Database to use when connecting to the server."
},
{
"timezone"
,
'
t
'
,
"TIMEZONE"
,
0
,
"Time zone of the shell, default is local."
},
{
"netrole"
,
'n'
,
"NETROLE"
,
0
,
"Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync."
},
{
"timezone"
,
'
z
'
,
"TIMEZONE"
,
0
,
"Time zone of the shell, default is local."
},
{
"netrole"
,
'n'
,
"NETROLE"
,
0
,
"Net role when network connectivity test, default is startup, options: client|server|rpc|startup|sync
|speen|fqdn
."
},
{
"pktlen"
,
'l'
,
"PKTLEN"
,
0
,
"Packet length used for net test, default is 1000 bytes."
},
{
0
}};
...
...
@@ -74,7 +74,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
}
break
;
case
'
t
'
:
case
'
z
'
:
arguments
->
timezone
=
arg
;
break
;
case
'u'
:
...
...
@@ -162,20 +162,25 @@ char LINUXCLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client
"Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
\n\n
"
;
char
g_password
[
SHELL_MAX_PASSWORD_LEN
];
static
void
parse_
password
(
static
void
parse_
args
(
int
argc
,
char
*
argv
[],
SShellArguments
*
arguments
)
{
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
{
if
((
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
strcpy
(
tsOsName
,
"Linux"
);
printf
(
LINUXCLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
if
(
strlen
(
argv
[
i
])
==
2
)
{
if
((
strlen
(
argv
[
i
])
==
2
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
printf
(
"Enter password: "
);
taosSetConsoleEcho
(
false
);
if
(
scanf
(
"%20s"
,
g_password
)
>
1
)
{
fprintf
(
stderr
,
"password reading error
\n
"
);
}
taosSetConsoleEcho
(
true
);
getchar
();
}
else
{
tstrncpy
(
g_password
,
(
char
*
)(
argv
[
i
]
+
2
),
SHELL_MAX_PASSWORD_LEN
);
strcpy
(
argv
[
i
],
"-p"
);
}
arguments
->
password
=
g_password
;
arguments
->
is_use_passwd
=
true
;
...
...
@@ -190,7 +195,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
argp_program_version
=
verType
;
if
(
argc
>
1
)
{
parse_
password
(
argc
,
argv
,
arguments
);
parse_
args
(
argc
,
argv
,
arguments
);
}
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
arguments
);
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
1c659a1c
...
...
@@ -78,20 +78,26 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
}
// for password
else
if
(
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
{
else
if
((
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
arguments
->
is_use_passwd
=
true
;
strcpy
(
tsOsName
,
"Windows"
);
printf
(
WINCLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
if
(
strlen
(
argv
[
i
])
==
2
)
{
if
((
strlen
(
argv
[
i
])
==
2
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
printf
(
"Enter password: "
);
taosSetConsoleEcho
(
false
);
if
(
scanf
(
"%s"
,
g_password
)
>
1
)
{
fprintf
(
stderr
,
"password read error!
\n
"
);
}
taosSetConsoleEcho
(
true
);
getchar
();
}
else
{
tstrncpy
(
g_password
,
(
char
*
)(
argv
[
i
]
+
2
),
SHELL_MAX_PASSWORD_LEN
);
}
arguments
->
password
=
g_password
;
strcpy
(
argv
[
i
],
""
);
argc
-=
1
;
}
// for management port
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
1c659a1c
...
...
@@ -243,8 +243,6 @@ static struct argp_option options[] = {
{
"table-batch"
,
't'
,
"TABLE_BATCH"
,
0
,
"Number of table dumpout into one output file. Default is 1."
,
3
},
{
"thread_num"
,
'T'
,
"THREAD_NUM"
,
0
,
"Number of thread for dump in file. Default is 5."
,
3
},
{
"debug"
,
'g'
,
0
,
0
,
"Print debug info."
,
8
},
{
"verbose"
,
'b'
,
0
,
0
,
"Print verbose debug info."
,
9
},
{
"performanceprint"
,
'm'
,
0
,
0
,
"Print performance debug info."
,
10
},
{
0
}
};
...
...
@@ -430,7 +428,6 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break
;
// dump unit option
case
'A'
:
g_args
.
all_databases
=
true
;
break
;
case
'D'
:
g_args
.
databases
=
true
;
...
...
@@ -553,11 +550,14 @@ static void parse_precision_first(
}
}
static
void
parse_
password
(
static
void
parse_
args
(
int
argc
,
char
*
argv
[],
SArguments
*
arguments
)
{
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
{
if
(
strlen
(
argv
[
i
])
==
2
)
{
if
((
strncmp
(
argv
[
i
],
"-p"
,
2
)
==
0
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
if
((
strlen
(
argv
[
i
])
==
2
)
||
(
strncmp
(
argv
[
i
],
"--password"
,
10
)
==
0
))
{
printf
(
"Enter password: "
);
taosSetConsoleEcho
(
false
);
if
(
scanf
(
"%20s"
,
arguments
->
password
)
>
1
)
{
...
...
@@ -567,9 +567,20 @@ static void parse_password(
}
else
{
tstrncpy
(
arguments
->
password
,
(
char
*
)(
argv
[
i
]
+
2
),
SHELL_MAX_PASSWORD_LEN
);
strcpy
(
argv
[
i
],
"-p"
);
}
argv
[
i
]
=
""
;
}
else
if
(
strcmp
(
argv
[
i
],
"-gg"
)
==
0
)
{
arguments
->
verbose_print
=
true
;
strcpy
(
argv
[
i
],
""
);
}
else
if
(
strcmp
(
argv
[
i
],
"-PP"
)
==
0
)
{
arguments
->
performance_print
=
true
;
strcpy
(
argv
[
i
],
""
);
}
else
if
(
strcmp
(
argv
[
i
],
"-A"
)
==
0
)
{
g_args
.
all_databases
=
true
;
}
else
{
continue
;
}
}
}
...
...
@@ -638,7 +649,7 @@ int main(int argc, char *argv[]) {
if
(
argc
>
1
)
{
parse_precision_first
(
argc
,
argv
,
&
g_args
);
parse_timestamp
(
argc
,
argv
,
&
g_args
);
parse_
password
(
argc
,
argv
,
&
g_args
);
parse_
args
(
argc
,
argv
,
&
g_args
);
}
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
&
g_args
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录