Permalink
Browse files

Merge pull request #4 from doxavore/master

Rename process.ARGV to process.argv for Node >= 0.5
  • Loading branch information...
2 parents e133cd9 + f2e67f3 commit 82ed9f93c8fc6377dd168bafb98940e28aa6c648 @geraud committed Dec 23, 2011
Showing with 20 additions and 20 deletions.
  1. +10 −10 jslint/node.coffee
  2. +10 −10 jslint/node.js
View
@@ -8,16 +8,16 @@
###
###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
@@ -45,10 +45,10 @@
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
@@ -57,13 +57,13 @@
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
View
@@ -8,14 +8,14 @@
*/
/*jslint rhino: false, node: true, strict: false
*/
-/*global require,sys,__filename,process
+/*global require,util,__filename,process
*/(function(args) {
- var JSLINT, filename, fs, input, input_filename, options, path, print_syntax, sys;
- sys = require('sys');
+ var JSLINT, filename, fs, input, input_filename, options, path, print_syntax, util;
+ util = require('util');
fs = require('fs');
path = require('path');
print_syntax = function() {
- sys.puts('Usage: jslint.js [options] file.js');
+ util.puts('Usage: jslint.js [options] file.js');
return process.exit(1);
};
if (args.length === 0) {
@@ -51,7 +51,7 @@
input_filename = arg;
input = fs.readFileSync(input_filename);
if (!input) {
- sys.puts("jslint: Couldn't open file '" + input_filename + "'.");
+ util.puts("jslint: Couldn't open file '" + input_filename + "'.");
process.exit(1);
} else {
input = input.toString('UTF8');
@@ -64,14 +64,14 @@
if (!JSLINT(input, options)) {
JSLINT.errors.forEach(function(error) {
if (error) {
- sys.puts("Lint at line " + error.line + " character " + error.character + ": " + error.reason);
- sys.puts((error.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
- return sys.puts('');
+ util.puts("Lint at line " + error.line + " character " + error.character + ": " + error.reason);
+ util.puts((error.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
+ return 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);
}
-})(process.ARGV.slice(2));
+})(process.argv.slice(2));

0 comments on commit 82ed9f9

Please sign in to comment.