Design for enhancing the command line help

Requirement/Problem:

Make command line help to improve the usability of command line. Users can know the version of toolkit and how to use comman line from the help.

Design Description:

1. Add printUsage method to CommandLineInterface

  /**
     * Prints the usage information for this class to <code>System.out</code>.
     */
    private static void printUsage() {
        String lSep = System.getProperty("line.separator");
        StringBuffer msg = new StringBuffer();
        msg.append("java -jar lib/dost.jar [mandatory parameters] [options]" + lSep);
        msg.append("Mandatory parameters:" + lSep);
        msg.append("  /i:{args.input}        specify the input file" + lSep);
        msg.append("  /transtype:{transtype} specify the transformation type" + lSep);
        msg.append("Options: " + lSep);
        msg.append("  -help, -h              print this message" + lSep);
        msg.append("  -version               print the version information and exit" + lSep);
        msg.append("  /basedir:{basedir}     specify the working directory" + lSep);
        msg.append("  /ditadir:{dita.dir}    specify the toolkit's home directory" + lSep);
        msg.append("  /outdir:{output.dir}   specify the output directory" + lSep);
        msg.append("  /tempdir:{dita.temp.dir} specify the temporary directory" + lSep);
        msg.append("  /logdir:{args.logdir}  specify the log directory" + lSep);
        msg.append("  /ditaext:{dita.extname} specify the dita file extension" + lSep);
        msg.append("  /filter:{dita.input.valfile} specify the filter file" + lSep);
        msg.append("  /draft:{args.draft}    specify whether to output draft info" + lSep);
        msg.append("  /artlbl:{args.artlbl}  specify whether to output artwork filenames" + lSep);
        msg.append("  /ftr:{args.ftr}        specify the file to be placed in the BODY running-footing area" + lSep);
        msg.append("  /hdr:{args.hdr}        specify the file to be placed in the BODY running-heading area" + lSep);
        msg.append("  /hdf:{args.hdf}        specify the file to be placed in the HEAD area" + lSep);
        msg.append("  /csspath:{args.csspath} specify the path for css reference" + lSep);
        msg.append("  /css:{args.css}        specify user css file" + lSep);
        msg.append("  /cssroot:{args.cssroot} specify the root directory for user specified css file" + lSep);
        msg.append("  /copycss:{args.copycss} specify whether to copy user specified css files" + lSep);
        msg.append("  /indexshow:{args.indexshow} specify whether each index entry should display within the body of the text itself" + lSep);
        msg.append("  /outext:{args.outext}  specify the output file extension for generated xhtml files" + lSep);
        msg.append("  /xsl:{args.xsl}           specify the xsl file used to replace the default xsl file" + lSep);
        msg.append("  /cleantemp:{clean.temp} specify whether to clean the temp directory before each build" + lSep);
        msg.append("  /foimgext:{args.fo.img.ext} specify the extension of image file in pdf transformation" + lSep);
        msg.append("  /javahelptoc:{args.javahelp.toc} specify the root file name of the output javahelp toc file in javahelp transformation" + lSep);
        msg.append("  /javahelpmap:{args.javahelp.map} specify the root file name of the output javahelp map file in javahelp transformation" + lSep);
        msg.append("  /eclipsehelptoc:{args.eclipsehelp.toc} specify the root file name of the output eclipsehelp toc file in eclipsehelp transformation" + lSep);
        msg.append("  /eclipsecontenttoc:{args.eclipsecontent.toc} specify the root file name of the output Eclipse content provider toc file in eclipsecontent transformation" + lSep);
        msg.append("  /provider:{args.eclipse.provider} specify the provider name of the eclipse help output" + lSep);
        msg.append("  /version:{args.eclipse.version} specify the version number of the eclipse help output" + lSep);
        msg.append("  /xhtmltoc:{args.xhtml.toc} specify the root file name of the output xhtml toc file in xhtml transformation" + lSep);
        msg.append("  /ditalocale:{args.dita.locale} specify the locale used for sorting indexterms." + lSep);
        msg.append("  /fooutputrellinks:{args.fo.output.rel.links} specify whether to output related links in pdf transformation" + lSep);
        msg.append("  /fouserconfig:{args.fo.userconfig} specify the user configuration file for FOP" + lSep);
        msg.append("  /htmlhelpincludefile:{args.htmlhelp.includefile} specify the file that need to be included by the HTMLHelp output" + lSep);
        System.out.println(msg.toString());
    }

2. Add printVersion method to CommandLineInterface
    private static void printVersion() {
        System.out.println("DITA Open Toolkit 1.3");
    }

3. Add 3 new options "-help", "-h", and "-version" into the command line interface, "-help" and "-h" are used to print usage information, "-version" is used to print the version info.
XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I