//- System.out.println("lenght: " + args.length + "\ti: " + i);
tmpArg = args[i];
if (tmpArg.startsWith("-")){
//- strip option designator '-' or '--'
tmpArg = tmpArg.substring(tmpArg.lastIndexOf("-") + 1);
ArgumentHandler aHandler = getArgHandler(tmpArg);
if(aHandler.isRequiresParameter() && i+1 < args.length){
aHandler.setRawParameters(args[++i]);
}
aList.add(aHandler);
// --passwordfile/-f creates credential ArgumentHandlers
aList.addAll(aHandler.getChildren());
if (aHandler instanceof ARG_target){
trgIndx = aList.indexOf(aHandler);
}
if (aHandler instanceof ARG_source){
srcIndx = aList.indexOf(aHandler);
}
}
//-System.out.println(" tmpArg: " + tmpArg);
}
//- force the src location to preceed target location
//- so future processing will proceed properly.
if (srcIndx > trgIndx){
ArgumentHandler tmpA = aList.remove(srcIndx);
aList.add(trgIndx, tmpA);
}
return aList;
}