Move printing of usage into a new function and use argv[0] as the
program name. This will help printing usage from multiple places.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
run_one_test (tests_tbl[i].testname, bandwidth_);
}
+static void
+usage (const char *progname)
+{
+ printf ("Usage: %s [-b] [-n] pattern\n", progname);
+ printf (" -n : benchmark nearest scaling\n");
+ printf (" -b : benchmark bilinear scaling\n");
+}
+
int
main (int argc, char *argv[])
{
if (!pattern)
{
- printf ("Usage: lowlevel-blt-bench [-b] [-n] pattern\n");
- printf (" -n : benchmark nearest scaling\n");
- printf (" -b : benchmark bilinear scaling\n");
+ usage (argv[0]);
return 1;
}