< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java

Print this page
rev 47329 : 8189102: All tools should support -?, -h and --help


 343         @Override
 344         public void process(OptionHelper helper, String option) throws InvalidValueException {
 345             Log log = helper.getLog();
 346             String ownName = helper.getOwnName();
 347             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "version", ownName,  JavaCompiler.version());
 348             super.process(helper, option);
 349         }
 350     },
 351 
 352     FULLVERSION("--full-version -fullversion", null, HIDDEN, INFO) {
 353         @Override
 354         public void process(OptionHelper helper, String option) throws InvalidValueException {
 355             Log log = helper.getLog();
 356             String ownName = helper.getOwnName();
 357             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "fullVersion", ownName,  JavaCompiler.fullVersion());
 358             super.process(helper, option);
 359         }
 360     },
 361 
 362     // Note: -h is already taken for "native header output directory".
 363     HELP("--help -help", "opt.help", STANDARD, INFO) {
 364         @Override
 365         public void process(OptionHelper helper, String option) throws InvalidValueException {
 366             Log log = helper.getLog();
 367             String ownName = helper.getOwnName();
 368             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "msg.usage.header", ownName);
 369             showHelp(log, OptionKind.STANDARD);
 370             log.printNewline(WriterKind.STDOUT);
 371             super.process(helper, option);
 372         }
 373     },
 374 
 375     A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC, ArgKind.ADJACENT) {
 376         @Override
 377         public boolean matches(String arg) {
 378             return arg.startsWith("-A");
 379         }
 380 
 381         @Override
 382         public boolean hasArg() {
 383             return false;




 343         @Override
 344         public void process(OptionHelper helper, String option) throws InvalidValueException {
 345             Log log = helper.getLog();
 346             String ownName = helper.getOwnName();
 347             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "version", ownName,  JavaCompiler.version());
 348             super.process(helper, option);
 349         }
 350     },
 351 
 352     FULLVERSION("--full-version -fullversion", null, HIDDEN, INFO) {
 353         @Override
 354         public void process(OptionHelper helper, String option) throws InvalidValueException {
 355             Log log = helper.getLog();
 356             String ownName = helper.getOwnName();
 357             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "fullVersion", ownName,  JavaCompiler.fullVersion());
 358             super.process(helper, option);
 359         }
 360     },
 361 
 362     // Note: -h is already taken for "native header output directory".
 363     HELP("-? --help", "opt.help", STANDARD, INFO) {
 364         @Override
 365         public void process(OptionHelper helper, String option) throws InvalidValueException {
 366             Log log = helper.getLog();
 367             String ownName = helper.getOwnName();
 368             log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "msg.usage.header", ownName);
 369             showHelp(log, OptionKind.STANDARD);
 370             log.printNewline(WriterKind.STDOUT);
 371             super.process(helper, option);
 372         }
 373     },
 374 
 375     A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC, ArgKind.ADJACENT) {
 376         @Override
 377         public boolean matches(String arg) {
 378             return arg.startsWith("-A");
 379         }
 380 
 381         @Override
 382         public boolean hasArg() {
 383             return false;


< prev index next >