Permalink
Browse files

Now with functional(!) command line argument hacks.

Vastly superior to the non-functional variety.
  • Loading branch information...
1 parent 8826402 commit a02401e8dbcea85eeb06b8bcb98425decef40ea8 @matthewd committed Nov 21, 2010
Showing with 3 additions and 5 deletions.
  1. +3 −5 bin/rasp
View
@@ -6,17 +6,15 @@ require 'rasp'
filename = File.exist?(ARGV.first) ? ARGV.shift : 't/math.vbs'
parse = Rasp::Parser.parse(File.read(filename), :consume => true)
-#puts parse.dump
-parse.value.graph if ARGV.grep /^--graph$/
-#p parse.value
+parse.value.graph unless ARGV.grep(/^--graph$/).empty?
-old_debug, $DEBUG = $DEBUG, ARGV.grep(/^--decode$/)
+old_debug, $DEBUG = $DEBUG, !ARGV.grep(/^--decode$/).empty?
begin
compiled = Rasp::Compiler.new.compile(parse.value, filename)
ensure
$DEBUG = old_debug
end
-compiled.call if ARGV.grep /^--run$/
+compiled.call unless ARGV.grep(/^--run$/).empty?

0 comments on commit a02401e

Please sign in to comment.