|
27 | 27 | #endif |
28 | 28 |
|
29 | 29 | #include <algorithm> |
| 30 | +#include <array> |
30 | 31 | #include <cstdio> |
31 | 32 | #include <cstring> |
32 | 33 | #include <stdexcept> |
@@ -128,6 +129,25 @@ void print_version() |
128 | 129 | #endif |
129 | 130 | } |
130 | 131 |
|
| 132 | +static void check_options_non_slim(CLI::App const &app) |
| 133 | +{ |
| 134 | + std::array<std::string, 7> const slim_options = { |
| 135 | + "--flat-nodes", |
| 136 | + "--middle-database-format", |
| 137 | + "--middle-schema", |
| 138 | + "--middle-with-nodes", |
| 139 | + "--middle-way-node-index-id-shift", |
| 140 | + "--tablespace-slim-data", |
| 141 | + "--tablespace-slim-index"}; |
| 142 | + |
| 143 | + for (auto const &opt : slim_options) { |
| 144 | + if (app.count(opt) > 0) { |
| 145 | + log_warn("Ignoring option {}. Can only be used in --slim mode.", |
| 146 | + app.get_option(opt)->get_name(false, true)); |
| 147 | + } |
| 148 | + } |
| 149 | +} |
| 150 | + |
131 | 151 | static void check_options_output_flex(CLI::App const &app) |
132 | 152 | { |
133 | 153 | auto const ignored_options = app.get_options([](CLI::Option const *option) { |
@@ -221,10 +241,6 @@ static void check_options(options_t *options) |
221 | 241 | "processing a lot."); |
222 | 242 | } |
223 | 243 | } |
224 | | - |
225 | | - if (!options->slim && !options->flat_node_file.empty()) { |
226 | | - log_warn("Ignoring --flat-nodes/-F setting in non-slim mode"); |
227 | | - } |
228 | 244 | } |
229 | 245 |
|
230 | 246 | static void check_options_expire(options_t *options) { |
@@ -687,6 +703,10 @@ options_t parse_command_line(int argc, char *argv[]) |
687 | 703 | return options; |
688 | 704 | } |
689 | 705 |
|
| 706 | + if (!options.slim) { |
| 707 | + check_options_non_slim(app); |
| 708 | + } |
| 709 | + |
690 | 710 | if (options.output_backend == "flex") { |
691 | 711 | check_options_output_flex(app); |
692 | 712 | } else if (options.output_backend == "gazetteer") { |
|
0 commit comments