better handling of float cli arguments

This commit is contained in:
2019-09-16 12:28:47 +02:00
parent b85b66caed
commit c3bc39750d
4 changed files with 39 additions and 8 deletions

View File

@@ -122,7 +122,14 @@ while ((opt = getopt(argc, argv, "d:ghn:o:O:p:s:uv")) != -1) {
case 'n': nbre_capt = atoi(optarg); break;
case 'O': dest_dir = optarg; break;
case 'o': outfile = optarg; break;
case 'p': period = 1e6*atof(optarg); break;
case 'p': foo = parse_double(optarg, &period);
if (foo<0) {
fprintf(stderr,
"error parsing -p arg '%s'\n",
optarg);
exit(1);
}
break;
case 's': parse_WxH(optarg, &width, &height);
break;
case 'u': upscaling = 1; break;