You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2012/02/28 16:46:44 UTC
svn commit: r1294727 -
/incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py
Author: stroucki
Date: Tue Feb 28 16:46:43 2012
New Revision: 1294727
URL: http://svn.apache.org/viewvc?rev=1294727&view=rev
Log:
tashi-client: print nicer message if arguments were not given correctly
Modified:
incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py
Modified: incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py?rev=1294727&r1=1294726&r2=1294727&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py Tue Feb 28 16:46:43 2012
@@ -563,12 +563,18 @@ def main():
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]