@@ -7,14 +7,16 @@ const cliOptions = [
77 { name : "module" , alias : "m" , type : Boolean } ,
88 { name : "output" , alias : "o" , type : String } ,
99 { name : "input" , alias : "i" , type : String } ,
10- { name : "spawn" , type : Boolean }
10+ { name : "spawn" , type : Boolean } ,
11+ { name : "source" , type : String }
1112] ;
1213const args = cliParser ( cliOptions ) ;
1314if ( ! ( "standalone" in args ) ) args . standalone = false ;
1415if ( ! ( "module" in args ) ) args . module = false ;
1516if ( ! ( "output" in args ) ) args . output = null ;
1617if ( ! ( "input" in args ) ) args . input = null ;
1718if ( ! ( "spawn" in args ) ) args . spawn = false ;
19+ if ( ! ( "source" in args ) ) args . source = null ;
1820function inputSource ( input , callback ) {
1921 fs . readFile ( input , function ( error , buffer ) {
2022 if ( error ) throw error ;
@@ -51,6 +53,8 @@ function compile(source) {
5153if ( args . input !== null ) {
5254 if ( args . output !== null ) console . log ( "Opening " + args . input + " for compilation." ) ;
5355 inputSource ( args . input , compile ) ;
56+ } else if ( args . source ) {
57+ compile ( args . source ) ;
5458} else {
5559 stdInSource ( compile ) ;
5660}
0 commit comments