@@ -72,6 +72,8 @@ struct option const long_options[] = {
7272 {" merc" , no_argument, nullptr , ' m' },
7373 {" middle-schema" , required_argument, nullptr , 215 },
7474 {" middle-way-node-index-id-shift" , required_argument, nullptr , 300 },
75+ {" middle-database-format" , required_argument, nullptr , 301 },
76+ {" middle-with-nodes" , no_argument, nullptr , 302 },
7577 {" multi-geometry" , no_argument, nullptr , ' G' },
7678 {" number-processes" , required_argument, nullptr , 205 },
7779 {" output" , required_argument, nullptr , ' O' },
@@ -450,6 +452,11 @@ static void check_options(options_t *options)
450452 throw std::runtime_error{" --drop only makes sense with --slim." };
451453 }
452454
455+ if (options->append && options->middle_database_format != 1 ) {
456+ throw std::runtime_error{
457+ " Do not use --middle-database-format with --append." };
458+ }
459+
453460 if (options->hstore_mode == hstore_column::none &&
454461 options->hstore_columns .empty () && options->hstore_match_only ) {
455462 log_warn (" --hstore-match-only only makes sense with --hstore, "
@@ -722,6 +729,20 @@ options_t parse_command_line(int argc, char *argv[])
722729 case 300 : // --middle-way-node-index-id-shift
723730 options.way_node_index_id_shift = atoi (optarg);
724731 break ;
732+ case 301 : // --middle-database-format
733+ if (optarg == std::string{" legacy" }) {
734+ options.middle_database_format = 1 ;
735+ } else if (optarg == std::string{" new" }) {
736+ options.middle_database_format = 2 ;
737+ } else {
738+ throw std::runtime_error{
739+ " Unknown value for --middle-database-format (Use 'legacy' "
740+ " or 'new')." };
741+ }
742+ break ;
743+ case 302 : // --middle-with-nodes
744+ options.middle_with_nodes = true ;
745+ break ;
725746 case 400 : // --log-level=LEVEL
726747 parse_log_level_param (optarg);
727748 break ;
@@ -771,5 +792,9 @@ options_t parse_command_line(int argc, char *argv[])
771792
772793 options.conninfo = build_conninfo (database_options);
773794
795+ if (!options.slim ) {
796+ options.middle_database_format = 0 ;
797+ }
798+
774799 return options;
775800}
0 commit comments