bin/boojs in boojs-0.0.11 vs bin/boojs in boojs-0.0.12
- old
+ new
@@ -4,15 +4,21 @@
require 'phantomjs'
#Parse
##########################################
parser = OptionParser.new do |opts|
- opts.banner = "Usage: boojs [-v file] [file]"
+ opts.banner = "Usage: boojs [-v file] [-e command] [file]"
+ #Verify this file
opts.on "-v FILE" do |f|
@vfile = f
end
+
+ #One-shot command
+ opts.on "-e COMMAND" do |c|
+ @c = c
+ end
end
parser.parse!
file = ARGV.pop
##########################################
@@ -20,10 +26,10 @@
#Run verify or run stdin/stdout mode?
if @vfile
BooJS.verify File.read(@file)
else
if file
- BooJS.pipe File.read(file)
+ BooJS.pipe File.read(file), @c
else
- BooJS.pipe
+ BooJS.pipe nil, @c
end
end