unify READ_INDICES to reduce clutter

This commit is contained in:
Yatao Li
2022-01-19 21:30:35 +08:00
parent 291d307689
commit 679e12f786
4 changed files with 31 additions and 50 deletions

View File

@@ -336,8 +336,7 @@ int index_args_validate(index_args_t *args, int argc, const char **argv) {
if (index_path == NULL) {
LOG_FATALF("cli.c", "Invalid PATH argument. File not found: %s", argv[1])
} else {
args->index_path = argv[1];
free(index_path);
args->index_path = index_path;
}
if (args->es_url == NULL) {
@@ -522,8 +521,7 @@ int exec_args_validate(exec_args_t *args, int argc, const char **argv) {
if (index_path == NULL) {
LOG_FATALF("cli.c", "Invalid index PATH argument. File not found: %s", argv[1])
} else {
args->index_path = argv[1];
free(index_path);
args->index_path = index_path;
}
if (args->es_url == NULL) {