/args2all

Converts args4j/JCommander descriptor classes to markdown or manpages

Primary LanguageJavaGNU General Public License v2.0GPL-2.0

Args2All

Travis CI Status License: GPL v2

Converts machine readable command line parser library class annotations (args4j, JCommander) into a variety of human readable text documents. To put it in other words: You document your options for i.e. args4j, and then you can extract the information for other documents using this tool from your Java classes.

The main purpose is to reduce overhead when documenting software.

Two examples can be seen below.

Command line parsing libraries supported

Currently the following command line libraries are supported:

Command line options

Usage is as follows:

java -jar target/args2all-0.0.1-jar-with-dependencies.jar <OPTIONS>

Where the possible options are listed here (args2all-generated):

  • -charset, -C = CHARSET

    The charset encoding to use for the output file.

  • -class, -c = CLASS

    Name of the annotated class to read. The annotations are from a library like args4j or JCommander. Note that the class must be loadable from the programs context, meaning reachable from the classpath.

    Required

  • -help, -h

    Show the command line help.

  • -out, -o = FILE

    The output where to write the result to.

    Required

  • -template, -t

    The template to use for output. This is the output flavor you are desiring to generate.

Output formats supported

The all in Args2all is quite limited at the moment. Please read the current options in the next sections.

Markdown

Outputs a markdown text that is inspired by the layout of UN*X manual pages.

Here's an example of the program itself:

Markdown example

Markdown code can be seen here.

Manpage

Outputs a partial manual page / troff page that can be used as a template. The parts of the file that need to be filled are marked as pseudo-variables, for example $DESCRIPTION.

Here's an example of the program itself:

Manpage example

Manpage code can be seen here.

XML

Outputs a XML dump that can be used for example in XML stylesheets.

XML page example is located here.

Warnings

It is possible that the library versions used with Args2all are not compatible with the versions you're using in the classes you've compiled. To get around this problem, adjust the problematic library versions to be the same on both sides.

License

Copyright 2017 Stephan Fuhrmann

Licensed under the GNU GENERAL PUBLIC LICENSE 2.0. Please see the licensing conditions under LICENSE or at https://www.gnu.org/licenses/gpl-2.0.html.