Skip to content

Commit 30cf67a

Browse files
committed
Added extraDigits to --boundaries
1 parent 28548ec commit 30cf67a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

example/mapcode.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void usage(const char* appName) {
8888
printf(" Encode a lat/lon to a Mapcode. If the territory code is specified, the\n");
8989
printf(" encoding will only succeeed if the lat/lon is located in the territory.\n");
9090
printf("\n");
91-
printf(" %s [-b | --boundaries]\n", appName);
91+
printf(" %s [-b | --boundaries] [<extraDigits>]\n", appName);
9292
printf(" %s [-g | --grid] <nrOfPoints> [<extraDigits>]\n", appName);
9393
printf(" %s [-r | --random] <nrOfPoints> [<extraDigits>] [<seed>]\n", appName);
9494
printf("\n");
@@ -491,11 +491,14 @@ int main(const int argc, const char** argv)
491491
// ------------------------------------------------------------------
492492
// Generate a test set based on the Mapcode boundaries.
493493
// ------------------------------------------------------------------
494-
if (argc != 2) {
494+
if ((argc < 2) || (argc > 3)) {
495495
fprintf(stderr, "error: incorrect number of arguments\n\n");
496496
usage(appName);
497497
return NORMAL_ERROR;
498498
}
499+
if (argc == 3) {
500+
extraDigits = atoi(argv[2]);
501+
}
499502

500503
resetStatistics(NR_BOUNDARY_RECS);
501504
for (int i = 0; i < totalNrOfPoints; ++i) {

0 commit comments

Comments
 (0)