mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
Return a successful error status for --help and --version
This commit is contained in:
@@ -2626,7 +2626,7 @@ int main(int argc, char **argv) {
|
|||||||
{"check-polygons", no_argument, &additional[A_DEBUG_POLYGON], 1},
|
{"check-polygons", no_argument, &additional[A_DEBUG_POLYGON], 1},
|
||||||
{"no-polygon-splitting", no_argument, &prevent[P_POLYGON_SPLIT], 1},
|
{"no-polygon-splitting", no_argument, &prevent[P_POLYGON_SPLIT], 1},
|
||||||
{"prefer-radix-sort", no_argument, &additional[A_PREFER_RADIX_SORT], 1},
|
{"prefer-radix-sort", no_argument, &additional[A_PREFER_RADIX_SORT], 1},
|
||||||
{"help", no_argument, 0, '?'},
|
{"help", no_argument, 0, 'H'},
|
||||||
|
|
||||||
{0, 0, 0, 0},
|
{0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
@@ -2961,7 +2961,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stderr, "tippecanoe %s\n", VERSION);
|
fprintf(stderr, "tippecanoe %s\n", VERSION);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
case 'P':
|
case 'P':
|
||||||
read_parallel = 1;
|
read_parallel = 1;
|
||||||
@@ -3004,7 +3004,7 @@ int main(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
if (i != '?') {
|
if (i != 'H') {
|
||||||
fprintf(stderr, "Unknown option -%c\n", i);
|
fprintf(stderr, "Unknown option -%c\n", i);
|
||||||
}
|
}
|
||||||
int width = 7 + strlen(argv[0]);
|
int width = 7 + strlen(argv[0]);
|
||||||
@@ -3034,10 +3034,14 @@ int main(int argc, char **argv) {
|
|||||||
width = 8;
|
width = 8;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
if (i == 'H') {
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
} else {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (additional[A_HILBERT]) {
|
if (additional[A_HILBERT]) {
|
||||||
encode_index = encode_hilbert;
|
encode_index = encode_hilbert;
|
||||||
|
|||||||
Reference in New Issue
Block a user