} else if (args[i].equals("-q") || args[i].equals("--quiet")) {
quiet = new Boolean(true);
} else if (args[i].equals("-c")) {
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("if you use '-c', you must specify the name of the configuration file");
} else {
userConfigFile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-l")) {
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("if you use '-l', you must specify a language");
} else {
language = args[i + 1];
i++;
}
} else if (args[i].equals("-s")) {
suppressLowLevelAreas = new Boolean(true);
} else if (args[i].equals("-fo")) {
inputmode = FO_INPUT;
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the fo file for the '-fo' option");
} else {
fofile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-xsl")) {
inputmode = XSLT_INPUT;
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the stylesheet file for the '-xsl' option");
} else {
xsltfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-xml")) {
inputmode = XSLT_INPUT;
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the input file for the '-xml' option");
} else {
xmlfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-awt")) {
setOutputMode(AWT_OUTPUT);
} else if (args[i].equals("-pdf")) {
setOutputMode(PDF_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the pdf output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-mif")) {
setOutputMode(MIF_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the mif output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-print")) {
setOutputMode(PRINT_OUTPUT);
// show print help
if (i + 1 < args.length) {
if (args[i + 1].equals("help")) {
printUsagePrintOutput();
return false;
}
}
} else if (args[i].equals("-pcl")) {
setOutputMode(PCL_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the pdf output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-ps")) {
setOutputMode(PS_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the PostScript output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-txt")) {
setOutputMode(TXT_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the text output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else if (args[i].charAt(0) != '-') {
if (inputmode == NOT_SET) {
inputmode = FO_INPUT;
fofile = new File(args[i]);
} else if (outputmode == NOT_SET) {
outputmode = PDF_OUTPUT;
outfile = new File(args[i]);
} else {
throw new FOPException("Don't know what to do with "
+ args[i]);
}
} else if (args[i].equals("-buf")) {
if (buffermode == NOT_SET) {
buffermode = BUFFER_FILE;
} else {
MessageHandler.errorln("ERROR: you can only set one buffer method");
printUsage();
}
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
MessageHandler.errorln("ERROR: you must specify the buffer output file");
printUsage();
} else {
bufferFile = new File(args[i + 1]);
i++;
}
} else if (args[i].equals("-at")) {
setOutputMode(AREA_OUTPUT);
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
throw new FOPException("you must specify the area-tree output file");
} else {
outfile = new File(args[i + 1]);
i++;
}
} else {