Java GetOpt Generator creates a command-line argument parser using an XML file as input. This tool streamlines the process of developing command-line interfaces.
Another feature of GetOpt Generator is that it is self-hosting. This means that it uses itself to generate its command-line parser. Users can check out the GetOpt.xml file as an example of what the XML configuration file should look like.
For each option, users should provide the name, long name of the option, short (1 char) alias, and type. The type can be one of: boolean, integer, string, input-file (verifying that the file exists), input-dir (verifying that the directory exists), output-file (treated as a string for now), or output-dir (treated as a string for now).
When users call GetOpt with --help, the software generates the following output options: [--help | -?], [--xmlFile | -x] xml_file, [--javaDir | -j] java_dir, [--exeClass | -e] exe_class, [--mainClass | -m] main_class, and [--configClass | -c] config_class. Note that options in brackets '[]' are optional. It is also important to note that all camel-case long opts can be represented using lowercase, as well as with '-' or '_' separating the camel-cased words.
To use GetOpt, users need to provide an XML file containing the configuration. They also need to give the fully qualified name (package+class) of the generated class that will parse the command line. The software also requires the fully qualified name (package_class) of the generated class that will store the config information. Users should provide the base output directory, which is typically their src directory, and the Java class that the generated command-line parser should call after parsing the command line. The exe class should contain a constructor that accepts a config_class instance and an execute() method, which will be called by the command-line parser. While it is the responsibility of the exe class to validate the parsed config, the config_class is generated with a validate() function that does the heavy lifting.
Version 0.81.1: N/A