未验证 提交 a8d688a7 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-6280]<fix>: taosdump -P determine input. (#7613)

上级 f9e22c16
......@@ -367,6 +367,15 @@ struct arguments g_args = {
false // performance_print
};
static void errorPrintReqArg2(char *program, char *wrong_arg)
{
fprintf(stderr,
"%s: option requires a number argument '-%s'\n",
program, wrong_arg);
fprintf(stderr,
"Try `taosdump --help' or `taosdump --usage' for more information.\n");
}
static void errorPrintReqArg3(char *program, char *wrong_arg)
{
fprintf(stderr,
......@@ -396,6 +405,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case 'p':
break;
case 'P':
if (!isStringNumber(arg)) {
errorPrintReqArg2("taosdump", "P");
exit(EXIT_FAILURE);
}
g_args.port = atoi(arg);
break;
case 'q':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册