better constructor
This commit is contained in:
parent
d77deb5a06
commit
013b7321f1
1 changed files with 10 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue