diff options
author | Kent Mein <mein@cs.umn.edu> | 2003-12-24 19:44:24 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2003-12-24 19:44:24 +0300 |
commit | e9a6c2d9969aac9516db7d8a9e121bf3d905c848 (patch) | |
tree | ce7b3d0c44cd74f4b848736b3aafedf3f6f1e0e6 /source/creator | |
parent | a7bed7804046f685533564cb7ee178f946c4e998 (diff) |
Dan Sinclair's patch to add --version or -v to blender's command line options.
Kent
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 9a93767c10e..8273f742015 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -107,6 +107,7 @@ extern char * build_type; /* Local Function prototypes */ static void print_help(); +static void print_version(); /* for the callbacks: */ @@ -139,7 +140,10 @@ static void blender_esc(int sig) } } - +static void print_version(void) +{ + printf ("Blender %d.%02d\n", G.version/100, G.version%100); +} static void print_help(void) { @@ -181,6 +185,7 @@ static void print_help(void) #ifdef WIN32 printf (" -R\t\tRegister .blend extension\n"); #endif + printf (" -v\t\tPrint Blender version and exit\n"); } @@ -258,6 +263,12 @@ int main(int argc, char **argv) exit(0); } + /* Handle long version request */ + if (!strcmp(argv[a], "--version")){ + print_version(); + exit(0); + } + /* Handle -* switches */ else if(argv[a][0] == '-') { switch(argv[a][1]) { @@ -301,7 +312,11 @@ int main(int argc, char **argv) case 'h': print_help(); exit(0); - + + case 'v': + print_version(); + exit(0); + default: break; } |