Permalink
Browse files

-x flag now reads in files

Still needs to pass these on.
  • Loading branch information...
1 parent 8b37bf8 commit fe8cf426a21382e1229889ef7a4c4a37584c5d56 @johngunderman johngunderman committed Feb 23, 2012
Showing with 7 additions and 2 deletions.
  1. +4 −2 bin/fuzzbuzz
  2. +3 −0 testdata/simple/example.out
View
@@ -184,7 +184,7 @@ def main(args):
elif opt in ('-E', '--list-engines'):
list_engines()
elif opt in ('-x', '--example'):
- examples.append(arg)
+ examples.append(assert_file_exists(arg))
elif opt in ('-t', '--table'):
tables.append(arg)
@@ -198,7 +198,9 @@ def main(args):
if engine_name not in fuzzbuzz.engines.registration:
log("Engine name '%s' not found, use -E to get a list" % engine_name)
usage(error_codes['bad_engine'])
-
+
+ for x in range(0, len(examples)):
+ examples[x] = read_file_or_die(examples[x])
grammar = fuzzbuzz.frontend.parse(read_file_or_die(grammar))
rlexer = import_module_or_die(lexer_module).stringifiers
engine = fuzzbuzz.engines.registration[engine_name]
@@ -0,0 +1,3 @@
+var thz = 221
+var xn = 218
+

0 comments on commit fe8cf42

Please sign in to comment.