--- jslint_old.js 2011-05-11 00:51:32.000000000 +0200 +++ jslint.js 2011-05-12 21:04:15.000000000 +0200 @@ -1,3 +1,4 @@ +#!@PREFIX@/bin/js // jslint.js // 2011-05-10 @@ -6674,4 +6675,34 @@ return itself; -}()); \ No newline at end of file +}()); + + +if(!arguments[0] || arguments[0]==="-h" || arguments[0]==="--help"){ + print('Usage : "jslint myscript.js option[=true]"'); +}else{ +var file=new File(arguments[0]); +file.open("read", "text"); +var script=file.readAll(); +var i; +var option= {}; +for (i = 1; i < arguments.length; i++) { + var splitoptions=arguments[i].split("="); + option[splitoptions[0]]=splitoptions[1]=="false"?false:true; +} +if(!JSLINT(script, option)){ +for (i = 0; i < JSLINT.errors.length; i++) { + var e = JSLINT.errors[i]; + if (e) { + print('Error at line ' + (e.line + 1) + ' character ' + (e.character + 1) + ': ' + e.reason); + if(e.evidence){ + print((e.evidence).replace(/^\s+/g,'').replace(/\s+$/g,'')); + } + print(''); + } + } + +}else{ +print("No error found"); +} +} \ No newline at end of file