Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "create" bool from options #2147

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/command-line-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ static void check_options_output_pgsql(CLI::App const &app, options_t *options)

static void check_options(options_t *options)
{
if (options->append && options->create) {
throw std::runtime_error{"--append and --create options can not be "
"used at the same time!"};
}

if (options->append && !options->slim) {
throw std::runtime_error{"--append can only be used with slim mode!"};
}
Expand Down Expand Up @@ -291,7 +286,7 @@ options_t parse_command_line(int argc, char *argv[])
->description("Update existing osm2pgsql database (needs --slim).");

// --create
app.add_flag("-c,--create", options.create)
app.add_flag("-c,--create")
->description("Import OSM data from file into database. This is the "
"default if --append is not used.");

Expand Down Expand Up @@ -687,6 +682,11 @@ options_t parse_command_line(int argc, char *argv[])
return options;
}

if (options.append && app.count("--create")) {
throw std::runtime_error{"--append and --create options can not be "
"used at the same time!"};
}

check_options(&options);

if (options.slim) { // slim mode, use database middle
Expand Down
1 change: 0 additions & 1 deletion src/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ struct options_t
bool reproject_area = false;

bool parallel_indexing = true;
bool create = false;
bool pass_prompt = false;
}; // struct options_t

Expand Down