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

[TD-6294]<fix>: taosdemo support long arg (#7589)

* [TD-6294]<fix>: taosdemo support long arg

fix conflict with develop branch.

* fix few words.

* declare default child tables number.
上级 dc89fa48
此差异已折叠。
......@@ -225,7 +225,6 @@ static struct argp_option options[] = {
{"password", 'p', 0, 0, "User password to connect to server. Default is taosdata.", 0},
#endif
{"port", 'P', "PORT", 0, "Port to connect", 0},
{"cversion", 'v', "CVERION", 0, "client version", 0},
{"mysqlFlag", 'q', "MYSQLFLAG", 0, "mysqlFlag, Default is 0", 0},
// input/output file
{"outpath", 'o', "OUTPATH", 0, "Output file path.", 1},
......@@ -244,7 +243,7 @@ static struct argp_option options[] = {
// dump format options
{"schemaonly", 's', 0, 0, "Only dump schema.", 2},
{"without-property", 'N', 0, 0, "Dump schema without properties.", 2},
{"avro", 'V', 0, 0, "Dump apache avro format data file. By default, dump sql command sequence.", 2},
{"avro", 'v', 0, 0, "Dump apache avro format data file. By default, dump sql command sequence.", 2},
{"start-time", 'S', "START_TIME", 0, "Start time to dump. Either epoch or ISO8601/RFC3339 format is acceptable. ISO8601 format example: 2017-10-01T00:00:00.000+0800 or 2017-10-0100:00:00:000+0800 or '2017-10-01 00:00:00.000+0800'", 4},
{"end-time", 'E', "END_TIME", 0, "End time to dump. Either epoch or ISO8601/RFC3339 format is acceptable. ISO8601 format example: 2017-10-01T00:00:00.000+0800 or 2017-10-0100:00:00.000+0800 or '2017-10-01 00:00:00.000+0800'", 5},
#if TSDB_SUPPORT_NANOSECOND == 1
......@@ -267,7 +266,6 @@ typedef struct arguments {
char *user;
char password[SHELL_MAX_PASSWORD_LEN];
uint16_t port;
char cversion[12];
uint16_t mysqlFlag;
// output file
char outpath[MAX_FILE_NAME_LEN];
......@@ -338,7 +336,6 @@ struct arguments g_args = {
"taosdata",
#endif
0,
"",
0,
// outpath and inpath
"",
......@@ -395,15 +392,6 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case 'q':
g_args.mysqlFlag = atoi(arg);
break;
case 'v':
if (wordexp(arg, &full_path, 0) != 0) {
errorPrint("Invalid client vesion %s\n", arg);
return -1;
}
tstrncpy(g_args.cversion, full_path.we_wordv[0], 11);
wordfree(&full_path);
break;
// output file path
case 'o':
if (wordexp(arg, &full_path, 0) != 0) {
errorPrint("Invalid path %s\n", arg);
......@@ -453,7 +441,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case 'N':
g_args.with_property = false;
break;
case 'V':
case 'v':
g_args.avro = true;
break;
case 'S':
......@@ -660,6 +648,9 @@ static void parse_timestamp(
}
int main(int argc, char *argv[]) {
static char verType[32] = {0};
sprintf(verType, "version: %s\n", version);
argp_program_version = verType;
int ret = 0;
/* Parse our arguments; every option seen by parse_opt will be
......@@ -686,7 +677,6 @@ int main(int argc, char *argv[]) {
printf("user: %s\n", g_args.user);
printf("password: %s\n", g_args.password);
printf("port: %u\n", g_args.port);
printf("cversion: %s\n", g_args.cversion);
printf("mysqlFlag: %d\n", g_args.mysqlFlag);
printf("outpath: %s\n", g_args.outpath);
printf("inpath: %s\n", g_args.inpath);
......@@ -715,11 +705,6 @@ int main(int argc, char *argv[]) {
}
}
printf("==============================\n");
if (g_args.cversion[0] != 0){
tstrncpy(version, g_args.cversion, 11);
}
if (taosCheckParam(&g_args) < 0) {
exit(EXIT_FAILURE);
}
......@@ -737,7 +722,6 @@ int main(int argc, char *argv[]) {
fprintf(g_fpOfResult, "user: %s\n", g_args.user);
fprintf(g_fpOfResult, "password: %s\n", g_args.password);
fprintf(g_fpOfResult, "port: %u\n", g_args.port);
fprintf(g_fpOfResult, "cversion: %s\n", g_args.cversion);
fprintf(g_fpOfResult, "mysqlFlag: %d\n", g_args.mysqlFlag);
fprintf(g_fpOfResult, "outpath: %s\n", g_args.outpath);
fprintf(g_fpOfResult, "inpath: %s\n", g_args.inpath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册