package net.happygiraffe.jslint;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

/**
 * A command line interface to {@link JSLint}.
 * 
 * @author dom
 * @version $Id$
 */
public class Main {

    /**
     * The main entry point. Try passing in "--help" for more details.
     * 
     * @param args  One or more JavaScript files.
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        JSLint lint = new JSLint();
        lint.addOption(Option.EQEQEQ);
        lint.addOption(Option.UNDEF);
        lint.addOption(Option.WHITE);
        for (String file : args) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    new FileInputStream(file)));
            List<Issue> issues = lint.lint(file, reader);
            for (Issue issue : issues) {
                System.err.println(issue);
            }
        }
    }

}

@@ -90,16 +90,54 @@
 Stream;%0A
+import java.io.FileNotFoundException;%0A
 import j
@@ -148,32 +148,32 @@
 io.IOException;%0A
-
 import java.io.I
@@ -431,16 +431,37 @@
 ram args
+%0A     *              
   One or
@@ -765,24 +765,169 @@
 e : args) %7B%0A
+            lintFile(lint, file);%0A        %7D%0A    %7D%0A%0A    private static void lintFile(JSLint lint, String file) throws IOException %7B%0A        try %7B%0A
             
@@ -1179,24 +1179,24 @@
 tln(issue);%0A
-
             
@@ -1193,24 +1193,124 @@
           %7D%0A
+        %7D catch (FileNotFoundException e) %7B%0A            System.err.println(file + %22:no such file%22);%0A
         %7D%0A  

Print out a file not found message instead of blowing up.