buildManager = new AjBuildManager(handler);
savedArgs = new String[args.length];
System.arraycopy(args, 0, savedArgs, 0, savedArgs.length);
+ for (int i = 0; i < args.length; i++) {
+ if ("-help".equals(args[i])) {
+ // should be info, but handler usually suppresses
+ MessageUtil.abort(handler, BuildArgParser.getUsage());
+ return true;
+ }
+ }
return doCommand(handler, false);
}
public class BuildArgParser extends Main {
private static final String BUNDLE_NAME = "org.aspectj.ajdt.ajc.messages";
+ private static boolean LOADED_BUNDLE = false;
/** to initialize super's PrintWriter but refer to underlying StringWriter */
private static class StringPrintWriter extends PrintWriter {
/** @return multi-line String usage for the compiler */
public static String getUsage() {
+ if (!LOADED_BUNDLE) { // get eclipse usage unless bundle loaded...
+ new BuildArgParser();
+ }
return Main.bind("misc.usage", Main.bind("compiler.version"));
}
public BuildArgParser(PrintWriter writer) {
super(writer, writer, false);
bundle = ResourceBundle.getBundle(BUNDLE_NAME);
+ if (!LOADED_BUNDLE) {
+ LOADED_BUNDLE = true;
+ }
if (writer instanceof StringPrintWriter) {
errorSink = ((StringPrintWriter) writer).stringWriter.getBuffer();
} else {