Index: benchmark/rmit.py
===================================================================
--- benchmark/rmit.py	(revision 6f1e6959274e5fd5f5141a4360c276ffa7cefcc9)
+++ benchmark/rmit.py	(revision af333e3d0cd105b684c355f254d9b8418a0f2a2c)
@@ -38,13 +38,5 @@
 		self.vars = re.findall("[a-zA-Z]", value)
 
-def parse_option(opt):
-	match = re.search("^(.*):(.*)$", opt)
-	if not match :
-		print('ERROR: extra options should match pattern .*:.*, got {}'.format(opt), file=sys.stderr)
-		sys.exit(1)
-
-	key    = match.group(1)
-	values = match.group(2)
-
+def parse_option(key, values):
 	try:
 		num = int(values)
@@ -121,13 +113,22 @@
 	parser = argparse.ArgumentParser(description='Python Script to implement R.M.I.T. testing : Randomized Multiple Interleaved Trials')
 	parser.add_argument('--list', help='List all the commands that would be run', action='store_true')
-	parser.add_argument('--format', help='How to print the result', choices=formats, default='json')
 	parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout)
-	parser.add_argument('-t', '--trials', help='Number of trials to run per combinaison', type=int, default=3)
-	parser.add_argument('-o','--option',action='append')
+	parser.add_argument('--trials', help='Number of trials to run per combinaison', type=int, default=3)
 	parser.add_argument('command', metavar='command', type=str, nargs=1, help='the command prefix to run')
 	parser.add_argument('candidates', metavar='candidates', type=str, nargs='*', help='the candidate suffix to run')
 
 	try:
-		options =  parser.parse_args()
+		options, unknown =  parser.parse_known_args()
+
+		options.option = []
+		while unknown:
+			key = unknown.pop(0)
+			val = unknown.pop(0)
+
+			if key[0] != '-':
+				raise ValueError
+
+			options.option.append((key[1:], val))
+
 	except:
 		print('ERROR: invalid arguments', file=sys.stderr)
@@ -150,5 +151,5 @@
 	# ================================================================================
 	# Identify the options to run
-	opts = dict([parse_option(o) for o in options.option])
+	opts = dict([parse_option(k, v) for k, v in options.option])
 
 	# Evaluate the options (options can depend on the value of other options)
@@ -177,14 +178,20 @@
 	# find expected time
 	time = actions_eta(actions)
-	print("Running {} trials{}".format(len(actions), "" if time == 0 else " (expecting to take {}".format(str(datetime.timedelta(seconds=int(time)))) ))
+	print("Running {} trials{}".format(len(actions), "" if time == 0 else " (expecting to take {})".format(str(datetime.timedelta(seconds=int(time)))) ))
 
 	random.shuffle(actions)
-	result = []
 
 	# ================================================================================
 	# Run
+	options.file.write("[")
+	first = True
 	for i, a in enumerate(actions):
 		sa = " ".join(a)
-		print("{}/{} : {}          \r".format(i, len(actions), sa), end = '')
+		if first:
+			first = False
+		else:
+			options.file.write(",")
+		if options.file != sys.stdout:
+			print("{}/{} : {}          \r".format(i, len(actions), sa), end = '')
 		fields = {}
 		with subprocess.Popen( a, stdout  = subprocess.PIPE, stderr  = subprocess.PIPE) as proc:
@@ -199,47 +206,9 @@
 					fields[match.group(1).strip()] = float(match.group(2).strip().replace(',',''))
 
-		result.append([a[0][2:], sa, fields])
-
-	print("Done                                                                                ")
-
-	# ================================================================================
-	# Print raw
-	if options.format == 'raw':
-		for r in result:
-			print(r, file=options.file)
-		sys.exit(0)
-
-	# ================================================================================
-	# Print json
-	if options.format == 'json':
-		json.dump(result, options.file)
-		sys.exit(0)
-
-	# ================================================================================
-	# Print csv
-	if options.format == 'csv':
-		# Clean result
-		headers = ["series", "command"]
-		data = []
-		first = True
-		for r in result:
-			if first:
-				first = False
-				headers.extend(r[2].keys())
-			else :
-				pass
-
-			d = [r[0], r[1]]
-			for k in headers[2:]:
-				try:
-					d.append(r[2][k])
-				except:
-					d.append(0.0)
-
-			data.append(d)
-
-		# Print csv
-		print(",\t".join(headers), file=options.file)
-		for d in data:
-			print(",\t".join(["{}".format(dd) for dd in d]), file=options.file)
-		sys.exit(0)
+		options.file.write(json.dumps([a[0][2:], sa, fields]))
+		options.file.flush()
+
+	options.file.write("]\n")
+
+	if options.file != sys.stdout:
+		print("Done                                                                                ")
