Skip to content

Commit ba12014

Browse files
committed
evp_fetch: factor out usage printing
Signed-off-by: Eugene Syromiatnikov <[email protected]>
1 parent e089376 commit ba12014

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

source/evp_fetch.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ void do_fetch(size_t num)
284284
} while (time.t < max_time.t);
285285
}
286286

287+
static void
288+
usage(const char *progname)
289+
{
290+
#ifdef OPENSSL_DO_PQ
291+
printf("Usage: %s [-t] [-q] threadcount\n", progname);
292+
#else
293+
printf("Usage: %s [-t] threadcount\n", progname);
294+
#endif
295+
printf("-t - terse output\n");
296+
#ifdef OPENSSL_DO_PQ
297+
printf("-q - include post-quantum algorithms\n");
298+
#endif
299+
}
300+
287301
int main(int argc, char *argv[])
288302
{
289303
OSSL_TIME duration;
@@ -311,15 +325,7 @@ int main(int argc, char *argv[])
311325
break;
312326
#endif
313327
default:
314-
#ifdef OPENSSL_DO_PQ
315-
printf("Usage: %s [-t] [-q] threadcount\n", basename(argv[0]));
316-
#else
317-
printf("Usage: %s [-t] threadcount\n", basename(argv[0]));
318-
#endif
319-
printf("-t - terse output\n");
320-
#ifdef OPENSSL_DO_PQ
321-
printf("-q - include post-quantum algorithms\n");
322-
#endif
328+
usage(basename(argv[0]));
323329
return EXIT_FAILURE;
324330
}
325331
}

0 commit comments

Comments
 (0)