         }
     }
     
+    private func validateOptions(_ args: [String]) -> Bool {
+        var validated = false
+        
+        for argument in args {
+            for (key, _) in usageDetails {
+                if argument == key {
+                    validated = true
+                }
+            }
+        }
+
+        return validated
+    }
+    
     func start(_ args: [String]) -> Void {
         if (findOption(args, option: "-h") || findOption(args, option: "-help") || args.count == 0) {
             usage()
             exit(0)
         }
 
+        if validateOptions(args) == false {
+            Utils.error("Invalid option")
+            usage()
+            exit(-1)
+        }
+        
         if (findOption(args, option: optHelpKeys)) {
             helpKeys()
             exit(0)

let optLangType = "-type"
let optPlatformType = "-platform"

let javaCommon =
"public final class Sango {\n" +
"    public static final String VERSION = \"\(App.copyrightNotice)\";\n" +

        
        print(App.copyrightNotice)
        print("Usage:")
        for (key, value) in Array(usageDetails).sorted(by: {$0.0 < $1.0}) {
            let item1 = value[0]
            let item2 = value[1]
            let output = key.padding(toLength: keyLength + 3, withPad: " ", startingAt: 0) +
