private Option parseOption(String[] args, int idx)
throws Exception
{
assert(idx < args.length);
Option opt = null;
for (Map.Entry<String,Option> entry: optionMap_.entrySet()) {
if (args[idx].equals(entry.getKey())) {
opt = entry.getValue();
idx ++;
/* Get arguments of the option */
for (int i = 0; i < opt.getArgc(); i ++) {
if (i < args.length == false) {
logger_.warning
(String.format
("The option %s requires more arguments.",
opt.getOpt()));
throw new Exception();
}
opt.addArg(args[idx ++]);
}
opt.nextIdx = idx;
break;
}