This is a syntax question.
I was looking at some open source files and I met some syntax that I cannot recognize and I was hoping you could clear it up for me.
(This is taken from the Main.java in the Rhino debugger here)
public static String[] processOptions(String args[])
{
String usageError;
goodUsage: for (int i = 0; ; ++i) {
if (i == args.length) {
return new String[0];
}
String arg = args[i];
if (!arg.startsWith("-")) {
processStdin = false;
fileList.add(arg);
String[] result = new String[args.length - i - 1];
System.arraycopy(args, i+1, result, 0, args.length - i - 1);
return result;
}
if (arg.equals("-version")) {
if (++i == args.length) {
usageError = arg;
break goodUsage;
}
int version;
try {
version = Integer.parseInt(args[i]);
} catch (NumberFormatException ex) {
usageError = args[i];
break goodUsage;
}
My question is what is goodUsage
? what is the name of this syntax, and what is it used for?