From 0747eefa1b1a6edb71cd6d0073955e39ccbd4858 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 10 Jan 2013 16:43:03 +0100 Subject: scripts: random-muscle-activation: check parameter min/max values --- scripts/random-muscle-activation.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/random-muscle-activation.py') diff --git a/scripts/random-muscle-activation.py b/scripts/random-muscle-activation.py index fb225cc..a4031fa 100755 --- a/scripts/random-muscle-activation.py +++ b/scripts/random-muscle-activation.py @@ -137,12 +137,22 @@ def main(): if N <= 0: print("Error: invalid number of data points ({}), must be > 0".format(N)) - usage() + sys.exit(-1) + + if not xmin < xmax: + print("Error: xmin must be smaller than xmax") + sys.exit(-1) + + if not ymin < ymax: + print("Error: ymin must be smaller than ymax") + sys.exit(-1) + + if not ydmin <= ydmax: + print("Error: ydmin must be smaller than or equal to ydmax") sys.exit(-1) if len(args) < 1: print("Error: no output file(s) specified") - usage() sys.exit(-1) for a in args: -- cgit v1.2.3-54-g00ecf