[DEV] add better error in arg parsing

This commit is contained in:
Edouard DUPIN 2013-05-24 22:02:09 +02:00
parent a181c5bdde
commit e1759a133e
2 changed files with 14 additions and 8 deletions

View File

@ -126,11 +126,15 @@ def Start():
#remove previous target
target = None
else:
#load the target if needed :
if target == None:
target = lutinTarget.TargetLoad(targetName, compilator, mode, generatePackage)
target.Build(argument.GetOptionName())
actionDone=True
if argument.GetOptionName() != "":
debug.warning("Can not understand argument : '" + argument.GetOptionName() + "'")
usage()
else:
#load the target if needed :
if target == None:
target = lutinTarget.TargetLoad(targetName, compilator, mode, generatePackage)
target.Build(argument.GetArg())
actionDone=True
# if no action done : we do "all" ...
if actionDone==False:
#load the target if needed :

View File

@ -15,9 +15,11 @@ class argElement:
def Display(self):
if len(self.m_arg)==0:
debug.info("element : " + self.m_option)
debug.info("option : " + self.m_option)
elif len(self.m_option)==0:
debug.info("element : " + self.m_arg)
else:
debug.info("element : " + self.m_option + ":" + self.m_arg)
debug.info("option : " + self.m_option + ":" + self.m_arg)
class argDefine:
@ -229,7 +231,7 @@ class lutinArg:
if argumentFound==False:
#unknow element ... ==> just add in the list ...
debug.verbose("unknow argument : " + argument)
listArgument.append(argElement(argument, ""))
listArgument.append(argElement("", argument))
#for argument in listArgument:
# argument.Display()