Add long options to tippecanoe-decode and tile-join. Add --quiet to tile-join.

This commit is contained in:
Eric Fischer
2017-07-07 12:51:49 -07:00
parent 412be8e6fc
commit c164a3e69b
7 changed files with 118 additions and 47 deletions
+26 -2
View File
@@ -3,6 +3,7 @@
#include <string.h>
#include <unistd.h>
#include <sqlite3.h>
#include <getopt.h>
#include <string>
#include <vector>
#include <map>
@@ -524,9 +525,32 @@ int main(int argc, char **argv) {
int i;
std::set<std::string> to_decode;
while ((i = getopt(argc, argv, "t:Z:z:l:f")) != -1) {
struct option long_options[] = {
{"projection", required_argument, 0, 's'},
{"maximum-zoom", required_argument, 0, 'z'},
{"minimum-zoom", required_argument, 0, 'Z'},
{"layer", required_argument, 0, 'l'},
{"force", no_argument, 0, 'f'},
{0, 0, 0, 0},
};
std::string getopt_str;
for (size_t lo = 0; long_options[lo].name != NULL; lo++) {
if (long_options[lo].val > ' ') {
getopt_str.push_back(long_options[lo].val);
if (long_options[lo].has_arg == required_argument) {
getopt_str.push_back(':');
}
}
}
while ((i = getopt_long(argc, argv, getopt_str.c_str(), long_options, NULL)) != -1) {
switch (i) {
case 't':
case 0:
break;
case 's':
set_projection_or_exit(optarg);
break;