// new style
Enumeration<String> argE = Collections.enumeration(Arrays.asList(args));
- ARG: while (argE.hasMoreElements())
+ while (argE.hasMoreElements())
{
String arg = argE.nextElement();
String argName = null;
{
// arg not found
Console.error("Argument '" + arg + "' not recognised. Ignoring.");
- continue ARG;
+ continue;
}
if (!a.hasOption(Opt.BOOLEAN) && negated)
{
// used "no" with a non-boolean option
Console.error("Argument '--" + NEGATESTRING + argName
+ "' not a boolean option. Ignoring.");
- continue ARG;
+ continue;
}
if (!a.hasOption(Opt.STRING) && equalPos > -1)
{
Console.error("Argument '--" + argName
+ "' does not expect a value (given as '" + arg
+ "'). Ignoring.");
- continue ARG;
+ continue;
}
if (!a.hasOption(Opt.LINKED) && linkedId != null)
{
Console.error("Argument '--" + argName
+ "' does not expect a linked id (given as '" + arg
+ "'). Ignoring.");
- continue ARG;
+ continue;
}
if (a.hasOption(Opt.STRING) && equalPos == -1)
// no value to take for arg, which wants a value
Console.error("Argument '" + a.getName()
+ "' requires a value, none given. Ignoring.");
- continue ARG;
+ continue;
}
val = argE.nextElement();
}