JSDOC/Options.js
[gnome.introspection-doc-generator] / JSDOC / Options.js
index dc031f1..fcd0bc9 100644 (file)
@@ -3,14 +3,15 @@
  * Options management...
  */
 XObject = import.XObject.XObject;
-XObject = import.File.File;
+File = import.File.File;
+
 Options = {
     
     "files" : [],  // was _
     "directory" : '',   // was d.
     "conf" : '',       // was c.
     "template": '',   // was t.
-    "recurse": '',   // was r.
+    "recurse": false,   // was r.
     "ext": '',   // was x.
     "private": '',   // was p
     "allfunctions": '',   // was a
@@ -39,9 +40,33 @@ Options = {
     },
     init : function()
     {
-        Log.verbose = this.verbose;
-        if (Options.conf) {
-            
+        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