jslint/node.coffee in jslint-1.1.2 vs jslint/node.coffee in jslint-1.1.3

- old
+ new

@@ -6,20 +6,20 @@ ### ###global JSLINT ### ###jslint rhino: false, node: true, strict: false ### -###global require,sys,__filename,process +###global require,util,__filename,process ### ((args) -> - sys = require 'sys' + util = require 'util' fs = require 'fs' path = require 'path' print_syntax = () -> - sys.puts 'Usage: jslint.js [options] file.js' + util.puts 'Usage: jslint.js [options] file.js' process.exit 1 print_syntax() if args.length is 0 filename = path.join path.dirname(__filename), 'jslint.js' @@ -43,27 +43,27 @@ options[RegExp.$1] = yes else input_filename = arg input = fs.readFileSync input_filename if not input - sys.puts "jslint: Couldn't open file '#{input_filename}'." + util.puts "jslint: Couldn't open file '#{input_filename}'." process.exit 1 else - # sys.debug('opening input'); + # util.debug('opening input'); input = input.toString 'UTF8' return print_syntax() if not input if not JSLINT input, options JSLINT.errors.forEach (error) -> if error - sys.puts "Lint at line #{error.line} character #{error.character}: #{error.reason}" - sys.puts (error.evidence or '').replace /^\s*(\S*(\s+\S+)*)\s*$/, "$1" - sys.puts '' + util.puts "Lint at line #{error.line} character #{error.character}: #{error.reason}" + util.puts (error.evidence or '').replace /^\s*(\S*(\s+\S+)*)\s*$/, "$1" + util.puts '' process.exit 2 else - sys.puts "jslint: No problems found in #{input_filename}" + util.puts "jslint: No problems found in #{input_filename}" process.exit 0 return -) process.ARGV.slice 2 +) process.argv.slice 2