diff --git a/geojson.c b/geojson.c index 93048c97..830cd412 100644 --- a/geojson.c +++ b/geojson.c @@ -19,6 +19,7 @@ #include "pool.h" #include "mbtiles.h" #include "projection.h" +#include "version.h" int low_detail = 10; int full_detail = -1; @@ -973,7 +974,7 @@ int main(int argc, char **argv) { prevent[i] = 0; } - while ((i = getopt(argc, argv, "l:n:z:Z:d:D:o:x:y:r:b:fXt:g:p:")) != -1) { + while ((i = getopt(argc, argv, "l:n:z:Z:d:D:o:x:y:r:b:fXt:g:p:v")) != -1) { switch (i) { case 'n': name = optarg; @@ -1045,6 +1046,10 @@ int main(int argc, char **argv) { } break; + case 'v': + fprintf(stderr, VERSION); + exit(EXIT_FAILURE); + default: fprintf(stderr, "Usage: %s -o out.mbtiles [-n name] [-l layername] [-z maxzoom] [-Z minzoom] [-d detail] [-D lower-detail] [-x excluded-field ...] [-y included-field ...] [-X] [-r droprate] [-b buffer] [-t tmpdir] [-p rcfs] [file.json ...]\n", argv[0]); exit(EXIT_FAILURE); diff --git a/version.h b/version.h new file mode 100644 index 00000000..3dfed500 --- /dev/null +++ b/version.h @@ -0,0 +1 @@ +#define VERSION "tippecanoe v1.2.0\n"