JSDOC/Options.js
[gnome.introspection-doc-generator] / JSDOC / Options.js
index beecc99..06a099f 100644 (file)
@@ -2,15 +2,17 @@
 /**
  * Options management...
  */
-
+XObject = import.XObject.XObject;
+File = import.File.File;
 
 Options = {
     
     "files" : [],  // was _
-    "directory" : '',   // was d.
+    "directory" : '',   // was d. ?? source directory (needed to put temporary files..)
+    "cacheDirectory" : '',
     "conf" : '',       // was c.
     "template": '',   // was t.
-    "recurse": '',   // was r.
+    "recurse": false,   // was r.
     "ext": '',   // was x.
     "private": '',   // was p
     "allfunctions": '',   // was a
@@ -39,7 +41,35 @@ Options = {
     },
     init : function()
     {
-        Log.verbose = this.verbose;
+        this.LOG.verbose = this.verbose;
+        
+        
+        if (this.conf) {
+            XObject.extend(this, JSON.parse(File.read(this.conf)));;
+        }
+        // help ?? -- usage..
+        
+        if (!this.files.length) {
+            throw {
+                name: "ArgumentError", 
+                message: "No files specified" 
+            };
+        }
+        if (!this.template) {
+            throw {
+                name: "ArgumentError", 
+                message: "No template specified" 
+            };
+        }
+         
+        if (!this.directory) {
+            throw {
+                name: "ArgumentError", 
+                message: "No directory specified" 
+            };
+        }
+         
+        
         
     }
 }
\ No newline at end of file