src/share/classes/com/sun/tools/javadoc/Start.java

changeset 1797
019063968164
parent 1413
bdcef2ef52d2
child 1961
58da1296c6b3
     1.1 --- a/src/share/classes/com/sun/tools/javadoc/Start.java	Mon Jun 03 17:09:26 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javadoc/Start.java	Mon Jun 03 17:24:47 2013 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -156,21 +156,8 @@
    1.11          usage(true);
    1.12      }
    1.13  
    1.14 -
    1.15 -    /**
    1.16 -     * Usage
    1.17 -     */
    1.18 -    private void usage(boolean exit) {
    1.19 -        // RFE: it would be better to replace the following with code to
    1.20 -        // write a header, then help for each option, then a footer.
    1.21 -        messager.notice("main.usage");
    1.22 -
    1.23 -        // let doclet print usage information (does nothing on error)
    1.24 -        if (docletInvoker != null) {
    1.25 -            docletInvoker.optionLength("-help");
    1.26 -        }
    1.27 -
    1.28 -        if (exit) exit();
    1.29 +    void usage(boolean exit) {
    1.30 +        usage("main.usage", "-help", null, exit);
    1.31      }
    1.32  
    1.33      @Override
    1.34 @@ -178,11 +165,28 @@
    1.35          Xusage(true);
    1.36      }
    1.37  
    1.38 -    /**
    1.39 -     * Usage
    1.40 -     */
    1.41 -    private void Xusage(boolean exit) {
    1.42 -        messager.notice("main.Xusage");
    1.43 +    void Xusage(boolean exit) {
    1.44 +        usage("main.Xusage", "-X", "main.Xusage.foot", exit);
    1.45 +    }
    1.46 +
    1.47 +    private void usage(String main, String doclet, String foot, boolean exit) {
    1.48 +        // RFE: it would be better to replace the following with code to
    1.49 +        // write a header, then help for each option, then a footer.
    1.50 +        messager.notice(main);
    1.51 +
    1.52 +        // let doclet print usage information (does nothing on error)
    1.53 +        if (docletInvoker != null) {
    1.54 +            // RFE: this is a pretty bad way to get the doclet to show
    1.55 +            // help info. Moreover, the output appears on stdout,
    1.56 +            // and <i>not</i> on any of the standard streams passed
    1.57 +            // to javadoc, and in particular, not to the noticeWriter
    1.58 +            // But, to fix this, we need to fix the Doclet API.
    1.59 +            docletInvoker.optionLength(doclet);
    1.60 +        }
    1.61 +
    1.62 +        if (foot != null)
    1.63 +            messager.notice(foot);
    1.64 +
    1.65          if (exit) exit();
    1.66      }
    1.67  

mercurial