incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1294727 - /incubator/tashi/branches/stroucki-tashi10/src/tashi/client/tashi-client.py
Date Tue, 28 Feb 2012 16:46:44 GMT
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]



Mime
View raw message