[TD-6280]<fix>: taosdump -P determine input. (#7613)
This commit is contained in:
parent
f9e22c1632
commit
a8d688a745
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue