6980021: javac should document @file command line option
authorjjg
Mon, 07 Mar 2011 13:45:06 -0800
changeset 8637 be1b564b50aa
parent 8636 baa2c3dffe9b
child 8638 a22e7a4637b3
child 8837 141b22c7e7b2
6980021: javac should document @file command line option Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java
langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java
langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties
langtools/test/tools/javac/diags/CheckResourceKeys.java
--- a/langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java	Mon Mar 07 11:37:54 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java	Mon Mar 07 13:45:06 2011 -0800
@@ -88,6 +88,7 @@
     O("-O"),
     XJCOV("-Xjcov"),
     XD("-XD"),
+    AT("@"),
     SOURCEFILE("sourcefile");
 
     public final String optionName;
--- a/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Mon Mar 07 11:37:54 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Mon Mar 07 13:45:06 2011 -0800
@@ -168,6 +168,7 @@
         O,
         XJCOV,
         XD,
+        AT,
         SOURCEFILE);
 
     static Set<OptionName> javacFileManagerOptions = EnumSet.of(
@@ -565,12 +566,27 @@
             }
         },
 
+        // This option exists only for the purpose of documenting itself.
+        // It's actually implemented by the CommandLine class.
+        new Option(AT,                   "opt.arg.file",         "opt.AT") {
+            @Override
+            String helpSynopsis() {
+                hasSuffix = true;
+                return super.helpSynopsis();
+            }
+            @Override
+            public boolean process(Options options, String option) {
+                throw new AssertionError
+                    ("the @ flag should be caught by CommandLine.");
+            }
+        },
+
         /*
          * TODO: With apt, the matches method accepts anything if
          * -XclassAsDecls is used; code elsewhere does the lookup to
          * see if the class name is both legal and found.
          *
-         * In apt, the process method adds the candiate class file
+         * In apt, the process method adds the candidate class file
          * name to a separate list.
          */
         new HiddenOption(SOURCEFILE) {
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties	Mon Mar 07 11:37:54 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties	Mon Mar 07 13:45:06 2011 -0800
@@ -146,6 +146,8 @@
     Print information about which annotations a processor is asked to process
 javac.opt.prefer=\
     Specify which file to read when both a source file and class file are found for an implicitly compiled class
+javac.opt.AT=\
+    Read options and filenames from file
 
 ## errors
 
--- a/langtools/test/tools/javac/diags/CheckResourceKeys.java	Mon Mar 07 11:37:54 2011 -0800
+++ b/langtools/test/tools/javac/diags/CheckResourceKeys.java	Mon Mar 07 13:45:06 2011 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6964768 6964461 6964469 6964487 6964460 6964481
+ * @bug 6964768 6964461 6964469 6964487 6964460 6964481 6980021
  * @summary need test program to validate javac resource bundles
  */