Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Sept_Lin
TDengine
提交
d6bfe443
TDengine
项目概览
Sept_Lin
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d6bfe443
编写于
8月 19, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix --password. change taos shell '-z' for timezone
上级
ab6cde02
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
46 addition
and
18 deletion
+46
-18
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
+11
-6
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
浏览文件 @
d6bfe443
...
...
@@ -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
浏览文件 @
d6bfe443
...
...
@@ -47,7 +47,7 @@ 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."
},
{
"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."
},
{
"pktnum"
,
'N'
,
"PKTNUM"
,
0
,
"Packet numbers used for net test, default is 100."
},
...
...
@@ -76,7 +76,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'
:
...
...
@@ -175,20 +175,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
;
...
...
@@ -203,7 +208,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
浏览文件 @
d6bfe443
...
...
@@ -82,20 +82,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
浏览文件 @
d6bfe443
...
...
@@ -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"
);
}
}
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
;
}
argv
[
i
]
=
""
;
}
}
}
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录