changeset 1112:febb63e773e4

Better error message.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 26 Feb 2009 21:01:21 +0100
parents ab726c059750
children c73d989810fb
files apps/multiply.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/apps/multiply.py	Fri Feb 20 10:20:34 2009 +0100
+++ b/apps/multiply.py	Thu Feb 26 21:01:21 2009 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-# Copyright 2008 VIFF Development Team.
+# Copyright 2008, 2009 VIFF Development Team.
 #
 # This file is part of VIFF, the Virtual Ideal Functionality Framework.
 #
@@ -24,10 +24,13 @@
 from viff.runtime import create_runtime, Runtime
 from viff.config import load_config
 
-parser = OptionParser()
+parser = OptionParser("%prog config input")
 Runtime.add_options(parser)
 (options, args) = parser.parse_args()
 
+if len(args) != 2:
+    parser.error("please supply a config file and an integer")
+
 Zp = GF(1031)
 
 id, players = load_config(args[0])