提交 07b54fc2 编写于 作者: J jjg

8007305: DPrinter: provide better usage message

Reviewed-by: mcimadamore
上级 938ac655
......@@ -1087,21 +1087,30 @@ public class DPrinter {
*/
static class Main {
public static void main(String... args) throws IOException {
Main m = new Main();
PrintWriter out = new PrintWriter(System.out);
try {
if (args.length == 0)
usage(out);
m.usage(out);
else
new Main().run(out, args);
m.run(out, args);
} finally {
out.flush();
}
}
static void usage(PrintWriter out) {
void usage(PrintWriter out) {
out.println("Usage:");
out.println(" java " + Main.class.getName() + " mode [options] [javac-options]");
out.println("where options include:");
out.print("where mode is one of: ");
String sep = "";
for (Handler h: getHandlers().values()) {
out.print(sep);
out.print(h.name);
sep = ", ";
}
out.println();
out.println("and where options include:");
out.println(" -before PARSE|ENTER|ANALYZE|GENERATE|ANNOTATION_PROCESSING|ANNOTATION_PROCESSING_ROUND");
out.println(" -after PARSE|ENTER|ANALYZE|GENERATE|ANNOTATION_PROCESSING|ANNOTATION_PROCESSING_ROUND");
out.println(" -showPositions");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册