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/29 20:56:23 UTC
svn commit: r1295268 -
/incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py
Author: stroucki
Date: Wed Feb 29 20:56:23 2012
New Revision: 1295268
URL: http://svn.apache.org/viewvc?rev=1295268&view=rev
Log:
tashi-client: deal with possible default values, especially if more options follow
Modified:
incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py
Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py?rev=1295268&r1=1295267&r2=1295268&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py Wed Feb 29 20:56:23 2012
@@ -570,7 +570,14 @@ def main():
if (arg.startswith("--")):
if (arg[2:] in possibleArgs):
(parg, conv, default, required) = possibleArgs[arg[2:]]
- val = conv(args.pop(0))
+ try:
+ val = None
+ lookahead = args[0]
+ if not lookahead.startswith("--"):
+ val = conv(args.pop(0))
+ except:
+ pass
+
if (val == None):
val = default()