#!/bin/bash
+#
+# Usage:
+# ./lint.sh [file.js]
+#
+# The zero-argument form lints everything.
+
jsc_opts='maxerr:10000,devel:true,browser:true'
rhino_opts='maxerr=10000,devel=true,browser=true'
-files=$(ls dygraph*.js | grep -v combined | grep -v dev.js);
+if [ $# -gt 1 ]; then
+ echo "Usage: $0 [file.js]"
+ exit 1
+fi
+
+if [ $# -eq 0 ]; then
+ files=$(ls dygraph*.js plugins/*.js | grep -v combined | grep -v dev.js)
+else
+ files=$1
+fi
if [ -e /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc ]; then
# use JSC (Safari/JavaScriptCore) to run JSHint -- much faster than Rhino.