]> git.cworth.org Git - vogl/commitdiff
Make voglgen accept specdir as option
authorSirAnthony <anthony@adsorbtion.org>
Fri, 21 Mar 2014 06:22:09 +0000 (12:22 +0600)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Apr 2014 19:37:31 +0000 (12:37 -0700)
src/voglgen/voglgen.cpp

index aa8eb96e75ca07734e13c2955c3fdef14dcb0f03..add362de62ff74b339839037e3f8f99a00a93653 100644 (file)
@@ -63,6 +63,7 @@ static command_line_param_desc g_command_line_param_descs[] =
         { "ctype_regex", 1, false, NULL },
         { "namespace_regex", 1, false, NULL },
         { "srcdir", 1, false, NULL },
+        { "specdir", 1, false, NULL },
     };
 
 //-----------------------------------------------------------------------------------------------------------------------
@@ -2019,7 +2020,14 @@ public:
     bool init()
     {
         // TODO: I'm going to move the "glspec" dir from under bin to raddebugger/glspec (or whatever)
-        if (!file_utils::does_file_exist("gl.spec"))
+        dynamic_string specdir;
+
+        if (g_command_line_params.get_value_as_string(specdir, "specdir"))
+        {
+            file_utils::change_directory(specdir.c_str());
+            console::warning("Changing current directory to %s\n", specdir.c_str());
+        }
+        else if (!file_utils::does_file_exist("gl.spec"))
         {
             if (file_utils::does_file_exist("glspec/gl.spec"))
             {