Skip to content

Commit

Permalink
Added a --version command line to mojoshader-compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 10, 2010
1 parent 00f9155 commit 804c05d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils/mojoshader-compiler.c
Expand Up @@ -218,6 +218,7 @@ static int compile(const char *fname, const char *buf, int len,
typedef enum
{
ACTION_UNKNOWN,
ACTION_VERSION,
ACTION_PREPROCESS,
ACTION_ASSEMBLE,
ACTION_COMPILE,
Expand Down Expand Up @@ -264,6 +265,13 @@ int main(int argc, char **argv)
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)
Expand Down Expand Up @@ -317,6 +325,12 @@ int main(int argc, char **argv)
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");

Expand Down

0 comments on commit 804c05d

Please sign in to comment.