glsl/standalone: point which arguments are mandatory
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 4 Jan 2018 15:38:00 +0000 (16:38 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 5 Jan 2018 07:52:22 +0000 (08:52 +0100)
Every now and then I execute the standalone compiler, get the
non-version error, and need to remember what I'm doing wrong

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/main.cpp

index 123e41f9dcc212521ef36ec929a8f889909c93ea..e082bd69757cd3f797be49e57d8e2f43875aeea7 100644 (file)
@@ -62,7 +62,10 @@ usage_fail(const char *name)
       "Possible options are:\n";
    printf(header, name);
    for (const struct option *o = compiler_opts; o->name != 0; ++o) {
-      printf("    --%s\n", o->name);
+      printf("    --%s", o->name);
+      if (o->has_arg == required_argument)
+         printf(" (mandatory)");
+      printf("\n");
    }
    exit(EXIT_FAILURE);
 }