diff --git a/src/js/core.js b/src/js/core.js index 2219448..374431f 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -241,7 +241,14 @@ const System = function() {}; System.prototype.init = function() { }; -const Option = function() {}; +const Option = function(cmd) { + if(cmd) { + const c = cmd.split("="); + + this.target = c[0]; + this.option = c[1]; + } +}; const Project = function(target) { this.target = target; @@ -296,12 +303,9 @@ pmake.File = File; /*** Option ***/ (function() { -const Compiler = new pmake.Option(); - +const Compiler = new pmake.Option("compiler=VALUE"); Compiler.category = "General"; -Compiler.target = "compiler"; Compiler.description = "Choose a compiler set; one of:"; -Compiler.option = "VALUE"; Compiler.options = function() { return Object.keys(pmake.compilers); @@ -311,12 +315,9 @@ Compiler.action = function(value) { pmake.setCompiler(value); }; -const System = new pmake.Option(); - +const System = new pmake.Option("system=VALUE"); System.category = "General"; -System.target = "system"; System.description = "Generate files for a different system; one of:"; -System.option = "VALUE"; System.options = function() { return Object.keys(pmake.systems);