@@ -202,8 +202,9 @@ void long_usage(char *arg0, bool verbose = false)
202202 pbf - OSM binary format.\n \
203203 -O|--output Output backend.\n \
204204 pgsql - Output to a PostGIS database (default)\n \
205+ flex - More flexible output to PostGIS database\n \
205206 multi - Multiple Custom Table Output to a PostGIS \n \
206- database (requires style file for configuration )\n \
207+ database (deprecated )\n \
207208 gazetteer - Output to a PostGIS database for Nominatim\n \
208209 null - No output. Useful for testing. Still creates tables if --slim is specified.\n " );
209210#ifdef HAVE_LUA
@@ -345,7 +346,7 @@ options_t::options_t(int argc, char *argv[]) : options_t()
345346#ifdef HAVE_GENERIC_PROJ
346347 projection = reprojection::create_projection (atoi (optarg));
347348#else
348- throw std::runtime_error ( " Generic projections not available." ) ;
349+ throw std::runtime_error{ " Generic projections not available." } ;
349350#endif
350351 break ;
351352 case ' p' :
@@ -389,18 +390,18 @@ options_t::options_t(int argc, char *argv[]) : options_t()
389390 break ;
390391 case ' e' :
391392 if (!optarg || optarg[0 ] == ' -' ) {
392- throw std::runtime_error (
393+ throw std::runtime_error{
393394 " Missing argument for option --expire-tiles. Zoom "
394- " levels must be positive.\n " ) ;
395+ " levels must be positive.\n " } ;
395396 }
396397 char *next_char;
397398 expire_tiles_zoom_min =
398399 static_cast <uint32_t >(std::strtoul (optarg, &next_char, 10 ));
399400 if (expire_tiles_zoom_min == 0 ) {
400- throw std::runtime_error (
401+ throw std::runtime_error{
401402 " Bad argument for option --expire-tiles. "
402403 " Minimum zoom level must be larger "
403- " than 0.\n " ) ;
404+ " than 0.\n " } ;
404405 }
405406 // The first character after the number is ignored because that is the separating hyphen.
406407 if (*next_char == ' -' ) {
@@ -411,20 +412,20 @@ options_t::options_t(int argc, char *argv[]) : options_t()
411412 expire_tiles_zoom = static_cast <uint32_t >(
412413 std::strtoul (next_char, &after_maxzoom, 10 ));
413414 if (expire_tiles_zoom == 0 || *after_maxzoom != ' \0 ' ) {
414- throw std::runtime_error ( " Invalid maximum zoom level "
415- " given for tile expiry.\n " ) ;
415+ throw std::runtime_error{ " Invalid maximum zoom level "
416+ " given for tile expiry.\n " } ;
416417 }
417418 } else {
418- throw std::runtime_error (
419- " Invalid maximum zoom level given for tile expiry.\n " ) ;
419+ throw std::runtime_error{
420+ " Invalid maximum zoom level given for tile expiry.\n " } ;
420421 }
421422 } else if (*next_char == ' \0 ' ) {
422423 // end of string, no second zoom level given
423424 expire_tiles_zoom = expire_tiles_zoom_min;
424425 } else {
425- throw std::runtime_error ( " Minimum and maximum zoom level for "
426+ throw std::runtime_error{ " Minimum and maximum zoom level for "
426427 " tile expiry must be separated by "
427- " '-'.\n " ) ;
428+ " '-'.\n " } ;
428429 }
429430 break ;
430431 case ' o' :
@@ -446,8 +447,8 @@ options_t::options_t(int argc, char *argv[]) : options_t()
446447 break ;
447448 case ' k' :
448449 if (hstore_mode != HSTORE_NONE) {
449- throw std::runtime_error ( " You can not specify both --hstore "
450- " (-k) and --hstore-all (-j)\n " ) ;
450+ throw std::runtime_error{ " You can not specify both --hstore "
451+ " (-k) and --hstore-all (-j)\n " } ;
451452 }
452453 hstore_mode = HSTORE_NORM;
453454 break ;
@@ -456,13 +457,13 @@ options_t::options_t(int argc, char *argv[]) : options_t()
456457 break ;
457458 case ' j' :
458459 if (hstore_mode != HSTORE_NONE) {
459- throw std::runtime_error ( " You can not specify both --hstore "
460- " (-k) and --hstore-all (-j)\n " ) ;
460+ throw std::runtime_error{ " You can not specify both --hstore "
461+ " (-k) and --hstore-all (-j)\n " } ;
461462 }
462463 hstore_mode = HSTORE_ALL;
463464 break ;
464465 case ' z' :
465- hstore_columns.push_back (optarg);
466+ hstore_columns.emplace_back (optarg);
466467 break ;
467468 case ' G' :
468469 enable_multi = true ;
@@ -477,13 +478,13 @@ options_t::options_t(int argc, char *argv[]) : options_t()
477478 parallel_indexing = false ;
478479 break ;
479480 case 204 :
480- if (strcmp (optarg, " dense" ) == 0 ) {
481+ if (std:: strcmp (optarg, " dense" ) == 0 ) {
481482 alloc_chunkwise = ALLOC_DENSE;
482- } else if (strcmp (optarg, " chunk" ) == 0 ) {
483+ } else if (std:: strcmp (optarg, " chunk" ) == 0 ) {
483484 alloc_chunkwise = ALLOC_DENSE | ALLOC_DENSE_CHUNK;
484- } else if (strcmp (optarg, " sparse" ) == 0 ) {
485+ } else if (std:: strcmp (optarg, " sparse" ) == 0 ) {
485486 alloc_chunkwise = ALLOC_SPARSE;
486- } else if (strcmp (optarg, " optimized" ) == 0 ) {
487+ } else if (std:: strcmp (optarg, " optimized" ) == 0 ) {
487488 alloc_chunkwise = ALLOC_DENSE | ALLOC_SPARSE;
488489 } else {
489490 throw std::runtime_error{
@@ -543,7 +544,7 @@ options_t::options_t(int argc, char *argv[]) : options_t()
543544
544545 // get the input files
545546 while (optind < argc) {
546- input_files.push_back ( std::string ( argv[optind]) );
547+ input_files.emplace_back ( argv[optind]);
547548 optind++;
548549 }
549550
@@ -566,19 +567,19 @@ options_t::options_t(int argc, char *argv[]) : options_t()
566567void options_t::check_options ()
567568{
568569 if (append && create) {
569- throw std::runtime_error ( " --append and --create options can not be "
570- " used at the same time!\n " ) ;
570+ throw std::runtime_error{ " --append and --create options can not be "
571+ " used at the same time!\n " } ;
571572 }
572573
573574 if (append && !slim) {
574- throw std::runtime_error ( " --append can only be used with slim mode!\n " ) ;
575+ throw std::runtime_error{ " --append can only be used with slim mode!\n " } ;
575576 }
576577
577578 if (droptemp && !slim) {
578- throw std::runtime_error ( " --drop only makes sense with --slim.\n " ) ;
579+ throw std::runtime_error{ " --drop only makes sense with --slim.\n " } ;
579580 }
580581
581- if (hstore_mode == HSTORE_NONE && hstore_columns.size () == 0 &&
582+ if (hstore_mode == HSTORE_NONE && hstore_columns.empty () &&
582583 hstore_match_only) {
583584 fprintf (stderr,
584585 " Warning: --hstore-match-only only makes sense with --hstore, "
@@ -587,7 +588,7 @@ void options_t::check_options()
587588 }
588589
589590 if (enable_hstore_index && hstore_mode == HSTORE_NONE &&
590- hstore_columns.size () == 0 ) {
591+ hstore_columns.empty () ) {
591592 fprintf (stderr, " Warning: --hstore-add-index only makes sense with "
592593 " hstore enabled.\n " );
593594 enable_hstore_index = false ;
@@ -601,8 +602,8 @@ void options_t::check_options()
601602
602603 if (cache == 0 ) {
603604 if (!slim) {
604- throw std::runtime_error (
605- " Ram node cache can only be disable in slim mode.\n " ) ;
605+ throw std::runtime_error{
606+ " Ram node cache can only be disable in slim mode.\n " } ;
606607 }
607608 if (!flat_node_cache_enabled) {
608609 fprintf (stderr, " WARNING: ram cache is disabled. This will likely "
0 commit comments