diff --git a/gp2rml/gp2rml.c b/gp2rml/gp2rml.c index b9697c8..72563ee 100644 --- a/gp2rml/gp2rml.c +++ b/gp2rml/gp2rml.c @@ -189,6 +189,7 @@ static void usage(const char *name) fprintf(stderr, "usage: %s [-s z_scale] z_clear[mm] xy_speed z_speed [file]\n\n" " -s z_scale scale Z axis by z_scale (default: 1.0)\n" +" -t top set the top elevation, in mm (default: auto-detect)\n" " z_clear clearance above the highest peak, in mm (must be > 0)\n" " Unit (\"mm\") can optionally be specified\n" " xy_speed cutting speed, in mm/s\n" @@ -206,13 +207,18 @@ int main(int argc, char *const *argv) double p[3]; int c; - while ((c = getopt(argc, argv, "s:")) != EOF) + while ((c = getopt(argc, argv, "s:t:")) != EOF) switch (c) { case 's': - z_scale = strtod(optarg &end); + z_scale = strtod(optarg, &end); if (*end) usage(*argv); break; + case 't': + z_max = strtod(optarg, &end); + if (*end && !strcmp(end, "mm")) + usage(*argv); + break; default: usage(*argv); }