Added a --version command line to mojoshader-compiler.
--- a/utils/mojoshader-compiler.c Sun Mar 07 08:08:35 2010 -0500
+++ b/utils/mojoshader-compiler.c Wed Mar 10 13:51:31 2010 -0500
@@ -218,6 +218,7 @@
typedef enum
{
ACTION_UNKNOWN,
+ ACTION_VERSION,
ACTION_PREPROCESS,
ACTION_ASSEMBLE,
ACTION_COMPILE,
@@ -264,6 +265,13 @@
action = ACTION_COMPILE;
} // else if
+ else if ((strcmp(arg, "-V") == 0) || (strcmp(arg, "--version") == 0))
+ {
+ if ((action != ACTION_UNKNOWN) && (action != ACTION_VERSION))
+ fail("Multiple actions specified");
+ action = ACTION_VERSION;
+ } // else if
+
else if (strcmp(arg, "-o") == 0)
{
if (outfile != NULL)
@@ -317,6 +325,12 @@
if (action == ACTION_UNKNOWN)
action = ACTION_ASSEMBLE;
+ if (action == ACTION_VERSION)
+ {
+ printf("mojoshader-compiler, changeset %s\n", MOJOSHADER_CHANGESET);
+ return 0;
+ } // if
+
if (infile == NULL)
fail("no input file specified");