tashi-client: print nicer message if arguments were not given correctly
git-svn-id: https://svn.apache.org/repos/asf/incubator/tashi/branches/stroucki-tashi10@1294727 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/tashi/client/tashi-client.py b/src/tashi/client/tashi-client.py
index 8bbfeb0..50c7809 100755
--- a/src/tashi/client/tashi-client.py
+++ b/src/tashi/client/tashi-client.py
@@ -563,12 +563,18 @@
f = getattr(client, function, None)
- if (f is None):
- f = extraViews[function][0]
- if (function in convertArgs):
- fargs = eval(convertArgs[function], globals(), vals)
- else:
- fargs = []
+ try:
+ if (f is None):
+ f = extraViews[function][0]
+ if (function in convertArgs):
+ fargs = eval(convertArgs[function], globals(), vals)
+ else:
+ fargs = []
+ except NameError, e:
+ print e
+ print "Please run tashi-client --examples for syntax information"
+ sys.exit(-1)
+
res = f(*fargs)
if (res != None):
keys = extraViews.get(function, (None, None))[1]