#!/usr/bin/env node

//if no arguments were given then display a helpful error message and kill the process
if (args.length < 2) {
  console.log('Usage: node ' + process.argv[1] + ' INPUTFILENAME OUTPUTFILENAME');
  process.exit(1);
}

//import the file system module
var fs = require('fs');
//import the PatternMatcher module
var PatternMatcher = require("./util/PatternMatcher");
//get the arguments we care about
var args = process.argv.splice(2);
//cache the filenames
var inputFilename = args[0];
var outputFilename = args[1];
 
fs.readFile(inputFilename, 'utf8', function(err, data) {
    if (err) throw err;
    //initialize the PatternMatcher
    PatternMatcher.init(data);
    
    fs.writeFile(outputFilename, PatternMatcher.outputMatches(), function(err) {
        if (err) throw err;

        console.log("Results were saved to : " + outputFilename);
    });
});
@@ -21,434 +21,435 @@
 %0A//i
-f no arguments were given then display a helpful error message and kill the process%0Aif (args.length %3C 2) %7B%0A  console.log('Usage: node ' + process.argv%5B1%5D + ' INPUTFILENAME OUTPUTFILENAME');%0A  process.exit(1);%0A%7D%0A%0A//import the file system module%0Avar fs = require('fs');%0A//import the PatternMatcher module%0Avar PatternMatcher = require(%22./util/PatternMatcher%22);%0A//get the arguments we care about%0Avar args = process.argv.splice(2);
+mport the file system module%0Avar fs = require('fs');%0A//import the PatternMatcher module%0Avar PatternMatcher = require(%22./util/PatternMatcher%22);%0A//get the arguments we care about%0Avar args = process.argv.splice(2);%0A%0A//if no arguments were given then display a helpful error message and kill the process%0Aif (args.length %3C 2) %7B%0A  console.log('Usage: node ' + process.argv%5B1%5D + ' INPUTFILENAME OUTPUTFILENAME');%0A  process.exit(1);%0A%7D%0A
 %0A//c

fix a large typo