Skip to content

Commit 664681d

Browse files
authored
Merge pull request #2147 from joto/remove-create-bool
Remove "create" bool from options
2 parents 13af586 + 32be519 commit 664681d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Diff for: src/command-line-parser.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ static void check_options_output_pgsql(CLI::App const &app, options_t *options)
208208

209209
static void check_options(options_t *options)
210210
{
211-
if (options->append && options->create) {
212-
throw std::runtime_error{"--append and --create options can not be "
213-
"used at the same time!"};
214-
}
215-
216211
if (options->append && !options->slim) {
217212
throw std::runtime_error{"--append can only be used with slim mode!"};
218213
}
@@ -291,7 +286,7 @@ options_t parse_command_line(int argc, char *argv[])
291286
->description("Update existing osm2pgsql database (needs --slim).");
292287

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

@@ -687,6 +682,11 @@ options_t parse_command_line(int argc, char *argv[])
687682
return options;
688683
}
689684

685+
if (options.append && app.count("--create")) {
686+
throw std::runtime_error{"--append and --create options can not be "
687+
"used at the same time!"};
688+
}
689+
690690
check_options(&options);
691691

692692
if (options.slim) { // slim mode, use database middle

Diff for: src/options.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ struct options_t
156156
bool reproject_area = false;
157157

158158
bool parallel_indexing = true;
159-
bool create = false;
160159
bool pass_prompt = false;
161160
}; // struct options_t
162161

0 commit comments

Comments
 (0)